permaculture playing cards*
The moose likes Tomcat and the fly likes JAVA_HOME Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "JAVA_HOME" Watch "JAVA_HOME" New topic
Author

JAVA_HOME

saravanan ragunathan
Ranch Hand

Joined: Aug 02, 2010
Posts: 84

when i run tomcat it needs JAVA_HOME environment variable.
then i set it as C:\programfiles\java\jdk; i included path seperator
at the end..then tomcat didn't recognize the JAVA_HOME ..
when i removed ; tomcat runs..is it false to include
path seperator in JAVA_HOME? if it is...why


"I Love Java Ranch"
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Most likely you wrote "programfiles" as one word, assuming that you didn't mis-type your example. "C:\Program Files" HAS to have the space in it, as the space is part of the directory name.

You also need to put the path in quotes, or the parser will stop at the space character, and you'll end up with "C"\Program", and that won't work, either.

An alternate way is to fall back on legacy 8.3 filename support, but the shortname of the directory isn't totally predictable. Usually, it's "C:\PROGRA~1", but not always. And I'm not even sure how well that works anymore. I haven't seen a lot of 8.3 support in Windows lately.


Customer surveys are for companies who didn't pay proper attention to begin with.
saravanan ragunathan
Ranch Hand

Joined: Aug 02, 2010
Posts: 84
hi Tim Holloway ..thanks for your reply....

As i copied the address from addressbar(c:\program files.....)i didn't get
any error for that..my question is whether i have to include ;(path seperator)
or not
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16019
    
  20

Just because you didn't get an error message doesn't mean it works, and what's legal in the address bar isn't always legal in a script.

Java doesn't care about the presence or absence of a terminating path separator, although I think it looks tidier not to use one.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAVA_HOME