• 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

problem setting JAVA_OPTS

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I'm trying to set JAVA_OPTS in catalina.bat as follows:

However when I double click startup.bat a command window opens and shuts immediately???
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to execute startup.bat from an open command prompt to see what is happening.

If another window opens and closes immediately you should change the last executable line of startup.bat from



to

so that catalina.bat will run in the same window and thus show the real error.

bill
 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok thanks bill. after doing what you said I am getting:

Please note when I do not add JAVA_OPTS tomcat starts up fine.

 
Saloon Keeper
Posts: 27762
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
Try replacing all the backslashes in your directory paths with "real" (forward) slashes. Backslash in Unix/Java is an escape character, so it's usually safer (and more conventient) to code filepaths in Unix form even when running Windows.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Create a separate setenv.bat file in the bin folder and add the above configuration in it.
example configuration: set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m
 
Tim Holloway
Saloon Keeper
Posts: 27762
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

Koshila Dissanayake wrote:Create a separate setenv.bat file in the bin folder and add the above configuration in it.
example configuration: set JAVA_OPTS=-Dfile.encoding=UTF-8 -Xms128m -Xmx1024m -XX:PermSize=64m -XX:MaxPermSize=256m



THIS is the solution. It ensures that your JVM is consistently configured.

If you must do a temporary configuration override, consider CATALINA_OPTS instead of JAVA_OPTS. But you're better using TOMCAT_HOME\bin\setenv.bat. or on Linux TOMCAT_HOME/bin/catalina.sh.

Note that the catalina.bat file is not supplied with Tomcat. You create your own from scratch. Don't know why they didn't supply a placeholder version.
 
reply
    Bookmark Topic Watch Topic
  • New Topic