This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes JAVA_PATH vs. JAVAHOME ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JAVA_PATH vs. JAVAHOME ??" Watch "JAVA_PATH vs. JAVAHOME ??" New topic
Author

JAVA_PATH vs. JAVAHOME ??

John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
i installed the j2se skd1.2 about a month ago. at the time,
i didn't really know what i was doing but i got it working.
(i bought the sun java tutorial 3rd ed. just for the newest
cd)
i now notice that i've got a JAVA_PATH environment variable
(set to /usr/local/jdk1.3). seems to work fine but some
books keep referring to JAVAHOME.
which is what?
and while i've got you here, when i type echo $PATH i get
my path, but if i try echo $JAVA_PATH i get nothing but
an empty line---even tho there's a line in my .bash_profile
that says:
export JAVA_PATH=/usr/local/jdk1.3
can anyone explain? thanks.
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
whoops. sorry. i was mis-typing.
echo $JAVA_PATH
gives me
/usr/local/jdk1.3
just fine as i would expect.
echo $JAVAHOME
gives me a blank line.
Val Dra
Ranch Hand

Joined: Jan 26, 2001
Posts: 439
I use Java_HOME only for TOMCAT USE it poitns to the Root dir where tomcat is located.
------------------
Val SCJP
going for SCJD


Val SCJP <BR>going for SCJD
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
uh oh.
you mean, besides the JAVA_PATH and JAVAHOME environment
variables i've asked about, there's also a JAVA_HOME
involved somehow?
I searched java.sun.com and only found some questionable
message board entries that contain references to all 3.
val, i assume you mean JAVA_HOME and not Java_HOME.
i don't have any idea what TOMCAT is.
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
On a Solaris (Unix) machine you set the environment parameters like this:
setenv JAVAHOME /home/linden/jdk1.2
set path=( $JAVAHOME/bin ... rest of path ... )
Some authors use the $JAVAHOME generically to mean the directory that you have the jdk in.
From the Windows installation configuration page for the JRE: http://www.javasoft.com/products/jdk/1.1/runtime.html

Name Default Value
JavaHome C:\Program Files\JavaSoft\JRE\1.1
RuntimeLib C:\Program Files\JavaSoft\JRE\1.1\bin\javai.dll
MicroVersion 8
Compiler Not set by default



[This message has been edited by Cindy Glass (edited March 15, 2001).]


"JavaRanch, where the deer and the Certified play" - David O'Meara
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
thanks for the reply cindy,
it looks to me like there is one environment variable called JAVAHOME for
solaris, and another one called JAVA_PATH for linux.
hmm... sounds too simple an explanation, i know.
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
ok, ok, ok. my little mystery is solved!
i'm posting this belated solution in the hopes that it
might help someone in the confused state i was once in.
JAVA_HOME, JAVAHOME, JAVA_PATH,... doesn't matter what
you call it. as of sdk1.3, it doesn't even seem to be
required anymore.
cindy gave me the clue when she wrote:
setenv JAVAHOME /home/linden/jdk1.2
a ha! jdk1.2. looking back through my books on the matter,
i now noticed that the only referring to JAVA_HOME
or JAVAHOME (JAVA_PATH evidently being a product of my
fevered imagination) were pre sdk1.3!
anyhoo, i tossed that one line from my .bash_profile
and everything compiles and runs just peachy---just as
it did before with that extra, unused environment variable.
cheerio!
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Kinda like self-testing code. . . - self fixing questions
Paul Bailey
Ranch Hand

Joined: Oct 20, 2000
Posts: 91
Java seems to work fine with out the JAVA_HOME defined, but Jext gets all mad about it. setenv JAVA_HOME /usr/java/jdk1.3.0_02/ does not seem to work for me.
I already have in my .bash_profile the folowing line of code
JAVA_HOME=/usr/java/jdk1.3.0_02/
but when i type
echo $JAVA_HOME
I get nothing.
I can set it at the command line with the same line as is in my .bash_profile, and the echo command give me the right response, but Jext still gets mad about it.
Any ideas?
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
<html>
paul,
i just added the following lines to my .bash_profile file(on a RedHat 7.0 machine):

export JAVA_HOME=/usr/local/jdk1.3
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH.:~/java

when i type "echo JAVA_HOME" i get

/usr/local/jdk1.3

and everything compiles / runs just fine... i could be crazy, but maybe you should take the "/" off the end of your line of code?

export JAVA_HOME=/usr/local/jdk1.3.0_02

oh, and do you have "export" at the beginning of the line?
[This message has been edited by Greg Harris (edited April 19, 2001).]


what?
Paul Bailey
Ranch Hand

Joined: Oct 20, 2000
Posts: 91
Greg,
Thanks a lot, that did it Now, what does export mean and why don't i have to export my path, for example?
Paul
John M. Gabriele
Ranch Hand

Joined: Feb 18, 2001
Posts: 232
wow! an old post of mine resurrected!
paul, PATH is *already* an environment variable---you
don't need to export it. JAVA_HOME is not an environment
variable---it's just one you made up; so you've gotta
export it.
heh, that answer makes it sound like i understand more
about bash than i really do!
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
well, it sounds like i know what i am doing too... but i don't. actually, since i started on the cattle drive i have found that it is easier to write code on my linux machine... if i have to use windows i make a point of writing in notepad and compiling in a dos-window, even though i have a very nice compiler created by auburn university students.
i am glad i could be some sort of help
[This message has been edited by Greg Harris (edited April 23, 2001).]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JAVA_PATH vs. JAVAHOME ??