Page 1 of 1

How can I specify multiple IBM_JAVA_OPTIONS?

PostPosted: Fri Apr 08, 2011 2:54 am
by Rob27
We are running z/OS 1.10 with J2RE 1.5.0. I am trying to run a job that invokes the USS JVM from a COBOL program via JNI using Enterprise COBOL 3.4.1. Obviously I cannot pass the JVM options on a command line, so I set up a sequential file that had all the environment variables required. One of these is IBM_JAVA_OPTIONS=-Xms16m -Xmx256m. There are times when there might be up to 5 options specified here. Unfortunately, it seems like only one is recognized at a time.

e.g.
IBM_JAVA_OPTIONS=-Xmx256m increases the maximum heap size (so my sequential file is being read and setting options) 8-)
but
IBM_JAVA_OPTIONS=-Xms16m -Xmx256m does not (maximum heap size remains at the default of 64m) :?

I have tried the following without success:
enclosing the options in double quotes, exporting the variable, using another variable like IJO and then $IJO, and separating options with commas.

Does anyone know how I can get multiple IBM_JAVA_OPTIONS to be recognized at the startup of the JVM?

Thanks!

Re: How can I specify multiple IBM_JAVA_OPTIONS?

PostPosted: Fri Apr 08, 2011 3:41 am
by Robert Sample
If java works anything like the rest of Unix System Services, you should use
export IBM_JAVA_OPTIONS="-Xms16m -Xmx256m"

Re: How can I specify multiple IBM_JAVA_OPTIONS?

PostPosted: Mon Apr 11, 2011 6:30 pm
by Rob27
Thank you for your reply, however I have tried that (i.e. double and single quotes) and it still uses the default (64 MB). Would anyone have any other ideas? This is really perplexing and I have a hard time believing that only one flag is acceptable.

Re: How can I specify multiple IBM_JAVA_OPTIONS?

PostPosted: Mon Apr 11, 2011 7:59 pm
by Robert Sample
The IBM manual indicates it'll work. If it doesn't, you need to open a PMR with IBM.
When you use the IBM_JAVA_OPTIONS environment variable, use this syntax:

set IBM_JAVA_OPTIONS=-Xtrace:<name>,<another_name>=<value>

or

export IBM_JAVA_OPTIONS=-Xtrace:<name>,<another_name>=<value>

Users of UNIX style shells should be aware that unwanted shell expansion might occur because of the characters used in the trace options. To avoid unpredictable results, you should enclose this command line option in quotes. For example:

java "-Xtrace:<name>,<another_name>=<value>" HelloWorld

For more information, please see the manual for your shell.

Re: How can I specify multiple IBM_JAVA_OPTIONS?

PostPosted: Mon Apr 11, 2011 8:05 pm
by Rob27
Thanks Robert. I will give it another go and will post my results (probably a little later today). I swear that I have tried all of this though. Either way, I will post so others may possibly benefit.