File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setting java_opts with value in it

 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to set java_opts having values with spaces in catalina.sh. I am trying this in unix. Can, somebody tell how we set java_opts with spaces in catalina.sh. I tried below and it doesn't work.
JAVA_OPTS="$JAVA_OPTS "-DargumentA=0 0 12 * * ?""
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17620
39
Android Eclipse IDE Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way to set Java/JVM options is to create a bin/setenv.sh or bin\setenv.bat file (depending on which OS you're using) and put the statement in that file. That way you don't have to modify the factory-supplied scripts.

You should, I believe, actually be able to simple make the setenv.sh contents look like this:



I don't believe that Tomcat has any existing JAVA_OPTS values to worry about.

However, I should caution you that it is NOT a good idea to pass configuration information into webapps via the JVM environment.

From the looks of it, you are attempting to set a cron-style schedule (probably for Quartz Scheduler) and make it externally customizable. I'd recommend doing this with an Environment sub-element in the webapp's Context definition. It's what I always do.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic