db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Susan Cline <home4...@pacbell.net>
Subject Re: PATH (newbie) problems...
Date Tue, 04 Apr 2006 20:32:39 GMT
Hi Dan,

See my comments interleaved in your message below.

Susan

--- dan <dan@elvberg.com> wrote:

> >From the getstartderby.pdf:
> "You need to set your PATH environment variable so the JVM and Java
> applications run
> correctly. This is extremely important for the success of your
> installation because the
> PATH variable enables your operating system to find the appropriate
> programs from any
> directory. If you have more than one JVM installed, the JVM you want to
> use must appear
> before any of the others in the PATH variable.
> To check the PATH environment variable:
>   1. In a command window, type the following:
>       java -version
>       If the path is set correctly, you will see a printout telling you
> the version of your JVM.
>   2. If the command does not return the correct version of your JVM, set
> the PATH
>       variable by adding the bin subdirectory of the JVM directory to
> the beginning of the
>       path.
>       For example, if the directory is C:\JDK1.4, add C:\JDK1.4\bin to
> the beginning
>       of the path.
>   3. Repeat step 1 to make sure the PATH environment variable is set
> correctly."
> 
> command
> java -version
> results in (I'm on Linux, Fedora Core 4):
> "
> $ java -version
> java version "1.4.2"
> gij (GNU libgcj) version 4.0.0 20050519 (Red Hat 4.0.0-8)

So currently your PATH variable is most likely pointing to 
the /usr/java/j2sdk1.4.2_09 installation.

Since java -version shows the version 1.4.2, it means that
java is found in your path already.

> In my /usr/java I have the folders
> j2sdk1.4.2_09
> jdk1.5.0_04
> jre1.5.0_04
> 
> but I have no JAVA_HOME when I
> echo $JAVA_HOME

Unless you have a need to set JAVA_HOME for some other application or
program (I could not find a reference to JAVA_HOME in the Getting Started
Guide) you do not need to set it for Derby.

If you want to set JAVA_HOME and you are running with a Borne or Korn
shell on Linux (as long as it is not csh) the following command will
set your JAVA_HOME environment variable:

$export JAVA_HOME=/usr/java/j2sdk1.4.2_09

> 
> >2. If the command does not return the correct version of your JVM, set
> the PATH
>       >variable by adding the bin subdirectory of the JVM directory to
> the beginning of the
>       >path.
> How do manage #2? /dan

Your PATH variable is set to a bin directory of a JVM, however it may  not
be the one you want based on your comments.

To see your current PATH type this:

$ echo $PATH

the output should be something like this (this is an example from my linux box):

sh-2.05b$ echo $PATH
/opt/kde3/bin:/opt/gnome/bin:/usr/games:/usr/bin/X11:/usr/local/bin:/usr/bin:/bin:/usr/lib/java/jre/bin

Also, if you use the 'which' command you should be able to see which java executable
your PATH includes.

sh-2.05b$ which java
/usr/lib/java/jre/bin/java

Now, if you want to change your PATH to pick up a different version of Java,
for instance, if you wanted to use your /usr/java/jdk1.5.0_04 version,
this command would work to set the PATH:

$ export PATH=/usr/java/jdk1.5.0_04/bin:$PATH


Mime
View raw message