Herman,
It might be that you're confusing the CLASSPATH environment variable with
the PATH variable. The CLASSPATH should not contain any references to where
the "java.exe" is located. This must be set in your PATH environment
variable.
Depending on which os you're on you can specify the jdk/bin directory in
different ways, ie:
Windows:
------------------------
Add a reference to the JDK bin directory in the PATH environment variable.
From the command line (cmd) this can be done by issuing the following
statement
set PATH=%PATH%;<path to your jdk bin directory>
To see what's in your path:
echo %PATH%
Setting the PATH environment can also be done by right-clicking the "My
computer"-icon on your desktop, selecting properties from the pop-up menu.
Click the "Advanced"-tab and select the "Environment variables"-button. the
Path can be appended from this window. By doing it this way, the PATH
environment will be set permanently as opposed to the method above where it
will only be set locally for the command prompt shell.
Linux:
------------------------
Set your PATH for the shell you're in by issuing the following statement:
export $PATH=$PATH:<path to your jdk bin directory>
To set the PATH more permanently for the logged in user, this depends upon
what kind of command shell you're using. For bash you can include the above
statements in the file ".user_profile" that is located on the user root
directory (~username).
Solaris:
------------------------
Manipulate the symbolic link /usr/java to point to the directory where the
JDK is installed. This can be done by deleting the existing symbolic link
and creating a new:
delete /usr/java
ln -s /usr/java :<path to your jdk directory>
I'm sorry for "overanswering" your request, but this is something lots are
troubled with, so I figured it wouldn't hurt with some details.
--
Millian Brave
"Herman" <he*******@hotmail.com> skrev i melding
news:d6************************@posting.google.com ...
Hi everyone, I recently installed the Sun J2SE SDK on my machine, and
I am having trouble running the java.exe interpreter for my Java
compiled code. I remember that I had to set my environment CLASSPATH
variable to whatever the current directory is, but I forgot the exact
characters to denote this. Or that there was an extra call to the
java interpreter (like -cp or -classpath) to indicate the current
directory, but that escapes me as well. Can anyone help?
Thanks