• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

How do I set PATH, CLASSPATH, JAVA_HOME in Windows ME ?

Ok,
I installed jdk1.5.0_02 in the directory C:
It automatically installed at C:\Program Files\Java\jdk1.5.0_02\bin ??
So, I assume my jdk directory is c:\Program Files\Java ?

I set the path variable as (in the autoexec  under C:    not autoexec.bat ??? )

SET PATH = %PATH%; C:\PROGRAM~1\JAVA\JDK1.5.0_02\BIN ( i added this part)

//the below part I left alone since it was already there for whatever reason..
;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF

Now, how do I set the classpath ??
How do I set the JAVA_HOME ?


Thanks.
_Esam
0
_Esam
Asked:
_Esam
  • 20
  • 19
1 Solution
 
zzynxSoftware engineerCommented:
See http://www.cs.ucsb.edu/~teliot/Path_and_Classpath.htm
(It's about Windows XP, but I guess that's no real problem)
0
 
_EsamAuthor Commented:
Ok, looks good but I need to make sure :

As I was informed earlier >>
In Windows ME , I can't add long directory names like Program Files ..
I had to quote it as "\Program Files" ? even to cd to Program Files
How does this apply to this ????


***************
These are taken from the bottom link above...

C:>set JAVA_HOME=C:\jdk1.3.1
 
You then have to update your PATH variable by appending C:\jdk1.3.1\bin. If JAVA_HOME has been properly set, you can enter the following: C:>set PATH=%PATH%;%JAVA_HOME%\bin

***************

If the full directory path to my \bin is :

C:\Program Files\Java\jdk1.5.0_02\bin  

What's my JAVA_HOME=?

C:>set AVA_HOME = "C:\Program Files\Java\jdk1.5.0_02"  (WITH OR WITHOUT QUOTES ?)

AND MY PATH IS:

C:>set PATH=%PATH%;%JAVA_HOME%\bin


_Esam
 

0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
zzynxSoftware engineerCommented:
>> I had to quote it as "\Program Files" ? even to cd to Program Files
>> WITH OR WITHOUT QUOTES ?
Then you certainly need the qoutes in
set JAVA_HOME = "C:\Program Files\Java\jdk1.5.0_02"
too
0
 
_EsamAuthor Commented:
This is confusing:

Isn't JAVA_HOME and PATH are related?

If I set>

set JAVA_HOME = "C:\Program Files\Java\jdk1.5.0_02"
What is me Set PATH =?

set PATH = %JAVA_HOME%\bin ????

_Esam


0
 
zzynxSoftware engineerCommented:
PATH and JAVA_HOME are just two different environment variables that need to be set.

- Windows ME uses the PATH variable (e.g. to search for executables you start)
- Java uses the JAVA_HOME variable
0
 
_EsamAuthor Commented:
>>>Windows ME uses the PATH variable (e.g. to search for executables you start)

This makes sense as Windows ME will eventually find it at:
C:\Program Files\Java\jdk1.5.0_02 from JAVA_HOME and then
\bin from PATH

As in:

set JAVA_HOME = "C:\Program Files\Java\jdk1.5.0_02"
What is me Set PATH =?

set PATH = %JAVA_HOME%\bin


>>>Java uses the JAVA_HOME variable
And what does this variable do?
Where does it direct to ? executables or ???  not clear ?

FINALLY,

I can't seem to use the command line to set the variables ....
Do I have to use the programs/access/........

Or Can I use a command line...

If so, ? (Tutorials on Windows ME is so VAGUE)

_Esam
0
 
zzynxSoftware engineerCommented:
>> set PATH = %JAVA_HOME%\bin
Sets the PATH variable = the content of the JAVA_HOME variable appended with "\bin"

JAVA_HOME is the path to your JDK installation


>> Can I use a command line
I quote from my 2nd link:

Windows Me

Go to the Start Menu, then choose Programs, Accessories, System Tools and System Information. A window titled "Microsoft Help and Support" should appear. Select the Tools menu, and choose the System Configuration Utility. Go to the Environment tab where you can edit the PATH variable. Append the value ;C:\jdk1.3.1\bin. Once you have changed and saved the value, you will be prompted to reboot.
0
 
_EsamAuthor Commented:
As suggested in the 2nd link:

I appended this to the PATH variable > C:\Progra~1\Java\jdk1.5.0_02\bin

Progra~1 is like Program Files (I guess they mean the same to the Win ME)

I appende this to the JAVA_HOME >  C:\PROGRA~1\Java\jdk1.5.0_02

How come I am not able to compile a java program from the command line?

If my myRMIInterface.java is at > C:\RMI\myRMIInterface.java

and I am at C:\RMI> and command javac myRMIInterface.java
it say bad command...((((((((I had it worked with Win 2000 earlier))))))))

Don't know what's wrong with Win ME (I can't change to Win 2000 right now)

_Esam
0
 
zzynxSoftware engineerCommented:
>> I appended this to the PATH variable > C:\Progra~1\Java\jdk1.5.0_02\bin
I hope you typed in the version without the ~.

That is:

set JAVA_HOME = "C:\Program Files\Java\jdk1.5.0_02"
followed by
set PATH = %PATH%;%JAVA_HOME%\bin

Did you type this? Litterally?

What output does these two produce? Can you post?

C:\RMI>java -version

C:\RMI>path
0
 
_EsamAuthor Commented:
C:\WINDOWS>cd ..

C:\>cd rmi

C:\RMI>path
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND

C:\RMI>java -version
java version "1.5.0_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_02-b09)
Java HotSpot(TM) Client VM (build 1.5.0_02-b09, mixed mode)

C:\RMI>path
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND

C:\RMI>

This is what I got now...
I thought I changed it ??
_Esam
0
 
_EsamAuthor Commented:
This is what I have under >Start>Programs>Accessories>System Tools>
Tools>System Configuration Utilities>

FOR PATH variable:

 C:\PROGRA~1\COMMON~1\MICROS~1\MSInfo\;;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF; \bin; C:\Progra~1\Java\jdk1.5.0_02\bin
0
 
zzynxSoftware engineerCommented:
>> FOR PATH variable:
>> C:\PROGRA~1\COMMON~1\MICROS~1\MSInfo\;;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF; \bin; C:\Progra~1\Java\jdk1.5.0_02\bin
1) You can delete that "\bin;" part
2) Looks OK

The fact that:
>> C:\RMI>java -version
produces
>> java version "1.5.0_02"
also proves it is OK.

I don't know why
>> C:\RMI>path
produces
>> PATH=C:\WINDOWS;C:\WINDOWS\COMMAND


Now,
>> I am at C:\RMI> and command javac myRMIInterface.java
>> it say bad command.
Can you check that you have the "javac.exe" file in C:\Program Files\Java\jdk1.5.0_02\bin?
0
 
_EsamAuthor Commented:
I did delete the \bin part from the PATH.

I have javac not javac.exe in C:\Program Files\Java\jdk1.5.0_02\bin

0
 
zzynxSoftware engineerCommented:
>> I have javac not javac.exe
You have javac.exe
but your Windows ME is apparently configured *not* to show you the common extensions like exe
0
 
zzynxSoftware engineerCommented:
And you also have java(.exe) in that same directory?
0
 
_EsamAuthor Commented:
I just saved myRMIInterface.java file in the \bin and went to this directory from the command line..
and javac myRMIInterface.java and it did work..

This means somehow the path variable is not being set up ??
_Esam
0
 
_EsamAuthor Commented:
I have javac in the \bin directory not javac.exe ?
(If javac is meant to be javac.exe - I guess it is - since a program compiled)

_Esam
0
 
zzynxSoftware engineerCommented:
>> This means somehow the path variable is not being set up ??
Indeed.


0
 
zzynxSoftware engineerCommented:
Can you post the output of

C:\RMI>set

C:\RMI>set JAVA_HOME

C:\RMI>set path=%PATH3%;%JAVA_HOME%\bin

C:\RMI>set
0
 
zzynxSoftware engineerCommented:
PATH3 was a typo.
Should have been PATH of course
0
 
_EsamAuthor Commented:
So how to solve it?

_Esam
0
 
_EsamAuthor Commented:
I deleted that entry.

This is all I have at the autoexec >>

SET COMSPEC=C:\WINDOWS\COMMAND.COM
SET windir=C:\WINDOWS
SET winbootdir=C:\WINDOWS
SET PROMPT=$p$g
SET TEMP=C:\WINDOWS\TEMP
SET TMP=C:\WINDOWS\TEMP
SET PATH = C:\Progra~1\Java\jdk1.5.0_02\bin; C:\PROGRA~1\COMMON~1\MICROS~1\MSInfo\;;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF
SET JAVA_HOME = C:\PROGRA~1\Java\jdk1.5.0_02

Anything suspicious?

_Esam
0
 
zzynxSoftware engineerCommented:
Can you post the output of

C:\RMI>set

C:\RMI>set JAVA_HOME

C:\RMI>set path=%PATH%;%JAVA_HOME%\bin

C:\RMI>set
0
 
_EsamAuthor Commented:

C:\RMI>set JAVA_HOME
Syntax error

C:\RMI>set path=%PATH%;%JAVA_HOME%\bin

C:\RMI>
C:\RMI>set path=%PATH%;%JAVA_HOME%\bin

C:\RMI>set
COMSPEC=C:\WINDOWS\COMMAND.COM
PROMPT=$p$g
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
PATH = C:\WINDOWS;C:\WINDOWS\COMMAND; \bin; C:\Progra~1\Java\jdk1.5.0_02\bin; C:
\PROGRA~1\COMMON~1\MICROS~1\MSInfo\;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF
JAVA_HOME = C:\PROGRA~1\Java\jdk1.5.0_02
winbootdir=C:\WINDOWS
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;\BIN;\BIN

C:\RMI>set path=%PATH%;%JAVA_HOME%\bin
0
 
_EsamAuthor Commented:
What is this?
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert

_Esam
0
 
zzynxSoftware engineerCommented:
>> What is this?
>> BLASTER=A220 I5 D1 T4 P330
Settings for your SoundBlaster sound card
>> CMDLINE=doskey /insert
Starts up the application doskey.
E.g. to make pressing <cursor up> work in a DOS-session
(=add on the command line what you previously typed)
0
 
zzynxSoftware engineerCommented:
>> PATH = C:\WINDOWS;C:\WINDOWS\COMMAND; \bin; C:\Progra~1\Java\jdk1.5.0_02\bin; C:
>> \PROGRA~1\COMMON~1\MICROS~1\MSInfo\;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF
>> JAVA_HOME = C:\PROGRA~1\Java\jdk1.5.0_02

1) JAVA_HOME is apparently not set
2) I see appear that useless "\bin;" again
3) C:\Progra~1\Java\jdk1.5.0_02\bin; is in the path, so javac should work
4) You have the things twice since you performed set path=... twice

I suggest the following.

1) Restart your computer
2) perform
         C:\RMI>set
3) Post the result
4) Then we'll go together step by step

OK?
0
 
_EsamAuthor Commented:
Ok, I restarted and performed C:\RMI>set and the result is:

C:\WINDOWS>cd ..

C:\>cd rmi

C:\RMI>set
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND
COMSPEC=C:\WINDOWS\COMMAND.COM
PROMPT=$p$g
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
PATH = C:\WINDOWS;C:\WINDOWS\COMMAND;C:\Progra~1\Java\jdk1.5.0_02\bin; C:\PROGRA
~1\COMMON~1\MICROS~1\MSInfo\;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF
JAVA_HOME = C:\PROGRA~1\Java\jdk1.5.0_02
winbootdir=C:\WINDOWS
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert

C:\RMI>

_Esam
0
 
_EsamAuthor Commented:
Looks like I have two PATH vairables ...
Should I delete the first one?

_Esam
0
 
zzynxSoftware engineerCommented:
Oohhhhhhh. I see.
You have a "path" variable (the one used) and a "path " variable (the one you adapted but which isn't used)

Do the following:

[1] To delete the bad one:

C:\RMI>set path =
(Remark: including the space between 'path' and '=')

[2]
C:\RMI>set path=%PATH%;%JAVA_HOME%\bin;

[3]
C:\RMI>set

And post the result




0
 
zzynxSoftware engineerCommented:
Remark for [2]: please ***NO*** space between 'path' and '='
0
 
zzynxSoftware engineerCommented:
I expect to see:

PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\Progra~1\Java\jdk1.5.0_02\bin;
COMSPEC=C:\WINDOWS\COMMAND.COM
PROMPT=$p$g
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
JAVA_HOME = C:\PROGRA~1\Java\jdk1.5.0_02
winbootdir=C:\WINDOWS
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert

In that case your compilation should work
0
 
_EsamAuthor Commented:
Here it is:

C:\WINDOWS>cd ..

C:\>cd rmi

C:\RMI>set path=%PATH%;%JAVA_HOME%\bin;

C:\RMI>set
COMSPEC=C:\WINDOWS\COMMAND.COM
PROMPT=$p$g
TEMP=C:\WINDOWS\TEMP
TMP=C:\WINDOWS\TEMP
PATH = C:\WINDOWS;C:\WINDOWS\COMMAND;C:\Progra~1\Java\jdk1.5.0_02\bin; C:\PROGRA
~1\COMMON~1\MICROS~1\MSInfo\;C:\WINDOWS;C:\WINDOWS\COMMAND;C:\ATF
JAVA_HOME = C:\PROGRA~1\Java\jdk1.5.0_02
winbootdir=C:\WINDOWS
windir=C:\WINDOWS
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert
PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;\BIN;

C:\RMI>

0
 
_EsamAuthor Commented:
There is some strange relationship (my misunderstanding perhaps) \bin at the last line
Perhaps due to JAVA_HOME?

_Esam
0
 
zzynxSoftware engineerCommented:
You didn't understand it quite well

[1] You should get rid off that "PATH " variable (that is the variable with the name PATH + a space)
      Therefor you should perform (including the space between 'path' and '=')

 C:\RMI>set path =

[2] Just correct the path variable by typing all in:

 C:\RMI>set PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;"C:\Program Files\Java\jdk1.5.0_02\BIN";

[3] Check if correct:

C:\RMI>set
0
 
_EsamAuthor Commented:
Gee,
It finally worked...
I was able to compile a program on this directrory (C:\RMI>)

>>C:\RMI>set path =  (It was all here :)

Thanks much zzynx and sorry for the trouble :)

A quick question >> not quite related .. but nobody is answering >>>

Here is the link>
http://experts-exchange.com/Web/Web_Servers/Apache/Q_21369401.html


Thanks.
_Esam
0
 
zzynxSoftware engineerCommented:
Thanks for accepting

>> It finally worked...
Pheew. That was a long one.
 ;°)

>> Here is the link
Sorry. I restrict myself to the java TA.
0
 
_EsamAuthor Commented:
Thanks then....

_Esam
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 20
  • 19
Tackle projects and never again get stuck behind a technical roadblock.
Join Now