Okay, so I'm adding an argument to my JAVA_OPTIONS as documented here. However, it is not working because of the space. Here is the line I am using in the UNIX shell script (just as the documentation specifies):
JAVA_OPTIONS="-DFRAMEWORK_HOME=${app_home}/conf
-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0
\"-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl\""
But I am getting the following error:
Exception in thread "main" java.lang.NoClassDefFoundError:
"-Dcom/sun/jndi/ldap/connect/pool/protocol=plain
I can easily do it if I do protocol=plain OR protocol=ssl, but I really need it to be "plain ssl".
Can anyone help?
Double quotes enclosing command line options where escaped double quotes surround the property value having a space seems to work.
$ export JAVA_OPTIONS="-Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0 \
-Dcom.sun.jndi.ldap.connect.pool.protocol=\"plain ssl\""
$ cat P.java
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
import java.util.List;
public class P {
public static void main(String[] args) {
Enumeration<?> e = System.getProperties().propertyNames();
List<String> list = new ArrayList<String>();
while (e.hasMoreElements()) {
list.add((String) e.nextElement());
}
Collections.sort(list);
for (String key : list) {
System.out.println(key + "=" + System.getProperty(key));
}
}
}
$ javac -d ~/classes P.java
$ java -classpath ~/classes $JAVA_OPTIONS P | grep com.sun.jndi.ldap.connect.pool.protocol
com.sun.jndi.ldap.connect.pool.protocol=plain ssl
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With