• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

JAVA_PATH vs. JAVAHOME ??  RSS feed

 
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 439
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use Java_HOME only for TOMCAT USE it poitns to the Root dir where tomcat is located.
------------------
Val SCJP
going for SCJD
 
John M. Gabriele
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
John M. Gabriele
Ranch Hand
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kinda like self-testing code. . . - self fixing questions
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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).]
 
Paul Bailey
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 232
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
today's feeble attempt to support the empire
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!