• 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

JAVA_HOME environment variable?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks
Now, I am kind of semi-new to Java programming (did manage to write a few programs some time back). But my problem is SOOO basic, it oughta be in this forum.
I was trying out my hand on Win XP on the J2EE SDK 1.4, as i needed to do some servlet/JSP programming. I downloaded it from Sun (about a 100 MB), installed it nicely such that my installation is in
C:\Sun

The installation is such that the directory hierarchy is:
C:\Sun\AppServer\ and then it has the various folders like jdk, bin, lib etc. etc.

Now I managed to compile a few java programs, so the PATH env. variable is set correctly (PATH = C:\Sun\AppServer\jdk\bin)
I now downloaded Jakarta Tomcat version 5.0.28, and installed it in C:\jakarta-5.0.28\
I was able to compile a java program that used the tomcat packages, so the CLASS_PATH variable is also set correctly.(CLASS_PATH = C:\jakarta-tomcat-5.0.28\common\lib\servlet-api.jar)
But my problem occurs when I try to run the startup.bat file in
C:\jakarta-5.0.28\bin\
to launch the tomcat server. It says that the JAVA_HOME variable hasn't been set correctly, and that Windows cannot find '-Djava.endorsed.dirs='.
Now, I googled for it all over, and everywhere it says that the JAVA_HOME variable ought to be whee the jdk is installed, so I set it to
C:\Sun\AppServer\jdk
but it still doesn't work.
ANy pointers please?
Anithinks
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to JavaRanch, Aniruddha!

CLASS_PATH should be CLASSPATH

You might need to set CATALINA_HOME to point to your Tomcat installation.

I think your problem is specific to Tomcat, so I'm moving this to the Tomcat forum...
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did setting the CATALINA_HOME value do the trick?

If not, I'd suggest a quick search on this forum for phrases such as "java.endorsed.dirs" and "Perhaps JAVA_HOME does not point to the JDK".

Any luck, yet?
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JAVA_HOME must point to that dir where there is a directory called bin and in this directory you can find all *.exe files (like java.exe, javac.exe,...)

so if these files are in c:\temp\blah_blah\bin\ the java_home has to be set to c:\temp\blah_blah

so you have to add to your catalina.bat-file
 
Aniruddha Bhagwat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
Thanks for your suggestions - I added JAVA_HOME to catalina.bat, but stillno luck.

Out of frustration, I uninstalled J2EE, and installed J2SE - don't know why I did that, just thought it might work - but still no luck.
Then I had a brainstorm - earlier I had set up a new environment variable for my OWN user, and this time, I set JAVA_HOME as a system variable.

Worked like a charm.
*sniff* Wish technology was easier in the dog days of your life.

SO, MORAL OF THE STORY: Set JAVA_HOME as C:/blah/blah/jdk in your SYSTEM VARIABLES, not user variables!!!
Thanks all anyway. Shall hear from me more often, now that I have atleast started here
anithinks

P.S: Say, where exactly is the Tomcat forum on the Big Moose Saloon page - can't seem to find it at all - have to come through the link you provided on the Java(beginner) thread.
 
Aniruddha Bhagwat
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, mea culpa, found the Apache/TOMCAT forum in the Products sub menu.
anithinks
 
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As an aside.. the reason you needed JAVA_HOME in the system variables (on Windows) is most likely because you installed Tomcat as a system Service.
 
reply
    Bookmark Topic Watch Topic
  • New Topic