How can I specify multiple IBM_JAVA_OPTIONS?



Support for Java SE, EE & ME, JVM, JNI, JDBC, EJB, JFC, JPDA, JAAS,JCE, JAXP, XML and Java API.

How can I specify multiple IBM_JAVA_OPTIONS?

Postby Rob27 » Fri Apr 08, 2011 2:54 am

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!
Rob27
 
Posts: 3
Joined: Fri Apr 08, 2011 2:21 am
Has thanked: 0 time
Been thanked: 0 time

Re: How can I specify multiple IBM_JAVA_OPTIONS?

Postby Robert Sample » Fri Apr 08, 2011 3:41 am

If java works anything like the rest of Unix System Services, you should use
export IBM_JAVA_OPTIONS="-Xms16m -Xmx256m"
Robert Sample
Global moderator
 
Posts: 3657
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 270 times

Re: How can I specify multiple IBM_JAVA_OPTIONS?

Postby Rob27 » Mon Apr 11, 2011 6:30 pm

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.
Rob27
 
Posts: 3
Joined: Fri Apr 08, 2011 2:21 am
Has thanked: 0 time
Been thanked: 0 time

Re: How can I specify multiple IBM_JAVA_OPTIONS?

Postby Robert Sample » Mon Apr 11, 2011 7:59 pm

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.
Robert Sample
Global moderator
 
Posts: 3657
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 270 times

Re: How can I specify multiple IBM_JAVA_OPTIONS?

Postby Rob27 » Mon Apr 11, 2011 8:05 pm

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.
Rob27
 
Posts: 3
Joined: Fri Apr 08, 2011 2:21 am
Has thanked: 0 time
Been thanked: 0 time


Return to Mainframe Java

 


  • Related topics
    Replies
    Views
    Last post