[Sussex] vvv confused with java - jre, sdk and jvm

Ronan Chilvers ronan at thelittledot.com
Mon Jul 25 12:01:22 UTC 2005


Hi John

On Mon, 25 Jul 2005 12:31:47 +0100
"John D." <john at johnsemail.eclipse.co.uk> wrote:

> Ronan Chilvers wrote:
> > On Mon, 25 Jul 2005 00:40:48 +0100
> > "John D." <john at johnsemail.eclipse.co.uk> wrote:

> > ;-)
> Ok, so I can see how that should work. I'm presuming that where Ronan 
> says "=[whatever]" does the whatever mean something like /usr/lib/jdk 
> 1.5.0 or something like that?

Sorry, John.  The [whatever] should be the path to your java
executables - no square brackets needed - that was just me!  So if your
java binaries are in /usr/lib/jdk/bin then the line would be

export JAVA_HOME=/usr/lib/jdk/bin

or wherever your java binaries live.  Should have been clearer about
that!  Apologies.

> 
> Plus, as I don't seem to be able to do either "locate xxxx" or
> "whereis xxxxx" how would I work out what I'm supposed to direct the
> "export JAVA_HOME=[whatever]" at ??? i.e. I don't know what file or
> sort of file it needs to be as when I checked the sun site, I found
> the bit that said about the structure of the JDK 
> http://java.sun.com/j2se/1.5.0/docs/tooldocs/linux/jdkfiles.html and
> as I'm sure you can see, it's somewhat confusing for a nugget like me.

The JAVA_HOME variable needs to be an environment variable.  So, if
you're starting the tomcat stuff from a terminal each time you can
simply bash in 

export JAVA_HOME=/usr/lib/jdk/bin

before you start tomcat.  Alternatively to register the environment
variable with every login, you can put it in your .bash_profile
or .bashrc files (located in your home directory), before the export
PATH lines. My .bash_profile file looks like this:-

#Get application paths with getpaths.sh script
BINPATHS=`$HOME/bin/getpaths.sh`
PATH=$PATH:$HOME/bin:$BINPATHS

export PATH

You might have something like this in yours:-

JAVA_HOME=/usr/lib/jdk/bin
PATH=$JAVA_HOME:$PATH:$HOME/bin

export PATH JAVA_HOME

This will register JAVA_HOME as an environment variable for any of
your login sessions. I'm not convinced you need the JAVA_HOME stuff in
your path, at least to run up tomcat, but you may need it for other
stuff I'm not aware of.

Does that make more sense?

If you need to run tomcat at boot, things get more complex, because you
have to make sure that the JAVA_HOME variable is available in the
environment when tomcat is trying to boot (outside any user logins)
which can be fiddly.

Cheers

Ronan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mailman.lug.org.uk/pipermail/sussex/attachments/20050725/76486b4a/attachment.pgp 


More information about the Sussex mailing list