This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to set path?

 
Dhivya rajagopal
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

hi if i give startup.bat in command prompt, it displays the following

Neither the JAVA_HOME nor the JRE_HOME environment variables is defined
At least one of these variable is needed to run this program.

can you please tell me how to set path?
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18212
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That isn't literally the "PATH", which is what is searched to find executable programs.

However, Tomcat does need to know the directory path of a Tomcat JDK, and it gets that information from one of the 2 environment variables you named.

You can set JAVA_HOME like this:


Note that quotes are REQUIRED because of the space in the name "Program files". Also, your actual installed JDK location and version will probably NOT be this exact location - this is only a sample.

You can also set JAVA_HOME system-wide using the Windows Control Panel/System applet. There is an "Environment" button that brings up a dialog. It has 2 parts. One is for setting environment name/value items for the current user, the other one sets for all users. Either one can be used. It won't update currently-open command windows, but new command windows will reflect the changes. Use the command: "echo %JAVA_HOME%" to see.
 
Akhilesh Trivedi
Ranch Hand
Posts: 1603
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you on windows?

You can do it via

MyComputer->rightclick->properties->Advanced->Environment Variables

Add new User Variable
Variable name = JAVA_HOME
Variable value = your_java_home_directory;your_java_home_directory/bin;

similarly add entries for tomcat.

To check if it is working, close all command prompts, open new command prompt and type "java -version" and enter. It should list configured java version.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic