Win a copy of Terraform in Action this week in the Cloud forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JAVA_HOME should point to a JDK not a JRE

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am not able to start my tomcat.
It is giving the below gien error:
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE

I have done th following settings in the user variables:

JAVA_HOME: C:\Program Files\Java\jdk1.6.0_24
CLASSPATH: E:\softwares\Tomcatnew\Tomcat\apache-tomcat-6.0.32\lib
PATH: C:\Program Files\Java\jdk1.6.0_24\lib;%JAVA_HOME%\bin

I have done th following settings in the system variables:

JAVA_HOME: C:\Program Files\Java\jdk1.6.0_24
CLASSPATH: E:\softwares\Tomcatnew\Tomcat\apache-tomcat-6.0.32\lib
PATH: %JAVA_HOME%\bin


Please let me know what settings am i missing here.
 
Sheriff
Posts: 22512
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are those actually user environment variables? Because unless Tomcat runs under your user account it doesn't see those. Change the JAVA_HOME variable into a system variable. You can also drop the other two as far as Tomcat is concerned, it doesn't need those. Especially the PATH variable is dangerous, as it removes all other PATH entries.
 
nattynids Gupta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

The same values are there in the system variables as well. Tried deleting the PATH as well.
No progress. Same result.
 
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any particular reason you have the \lib under path? Keep only the System variables and try removing the \lib from the Path variable. Let this be @ first path - C:\Program Files\Java\jdk1.6.0_24\bin. Try java -version in the cmd prompt and confirm if your path is right. Open a new cmd prompt after altering these values.
 
nattynids Gupta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,

No particular reason why lib was there.
I modified the PATH to C:\Program Files\Java\jdk1.6.0_24\bin
Still the same error.
Do i need to restart the sytem after these changes?
What i did was i modified the PATH & restarted the Tomcat.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen this error recently and resolved by configuring JAVA_HOME as a System Variable. Just after configuring and starting Tomcat again it worked well.
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try below commands and check if you are getting desired results -
 
nattynids Gupta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi John,

I got the following:

C:\Users\nigupta6>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_24

C:\Users\nigupta6>echo %PATH%
C:\Program Files\Java\jdk1.6.0_24\bin;C:\Program Files\Java\jdk1.6.0_24\bin
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yikes - So the JAVA_HOME is pointed to a JDK but still you get the error like JAVA_HOME should point to a JDK and not a JRE?
Is the error still occurring while starting Tomcat?
 
nattynids Gupta
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes ji...
Tel me do we need to map from java build path in eclipse?
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

nattynids Gupta wrote:yes ji...
Tel me do we need to map from java build path in eclipse?



Are you starting Tomcat from within Eclipse? Try restarting eclipse.
 
nattynids Gupta
Greenhorn
Posts: 6
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all...
The issue was the incorrect path in the Catalina file in Tomcat...
 
John Jai
Rancher
Posts: 1776
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
he he... thanks for sharing that
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i'm having same problem as you, could you please help me in solving it.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic