• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting java_opts with value in it

 
Ranch Hand
Posts: 418
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 * * ?""
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic