Link to home
Start Free TrialLog in
Avatar of _Esam
_Esam

asked on

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
Avatar of zzynx
zzynx
Flag of Belgium image

See http://www.cs.ucsb.edu/~teliot/Path_and_Classpath.htm
(It's about Windows XP, but I guess that's no real problem)
Avatar of _Esam
_Esam

ASKER

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
 

>> 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
Avatar of _Esam

ASKER

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


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
Avatar of _Esam

ASKER

>>>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
>> 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.
Avatar of _Esam

ASKER

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
>> 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
Avatar of _Esam

ASKER

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
Avatar of _Esam

ASKER

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
>> 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?
Avatar of _Esam

ASKER

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

>> 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
And you also have java(.exe) in that same directory?
Avatar of _Esam

ASKER

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
Avatar of _Esam

ASKER

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
>> This means somehow the path variable is not being set up ??
Indeed.


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
PATH3 was a typo.
Should have been PATH of course
Avatar of _Esam

ASKER

So how to solve it?

_Esam
Avatar of _Esam

ASKER

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
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
Avatar of _Esam

ASKER


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
Avatar of _Esam

ASKER

What is this?
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert

_Esam
>> 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)
>> 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?
Avatar of _Esam

ASKER

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
Avatar of _Esam

ASKER

Looks like I have two PATH vairables ...
Should I delete the first one?

_Esam
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




Remark for [2]: please ***NO*** space between 'path' and '='
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
Avatar of _Esam

ASKER

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>

Avatar of _Esam

ASKER

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

_Esam
ASKER CERTIFIED SOLUTION
Avatar of zzynx
zzynx
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of _Esam

ASKER

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>
https://www.experts-exchange.com/questions/21369401/Download-and-Install-TomCat-5-under-Windows-ME.html


Thanks.
_Esam
Thanks for accepting

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

>> Here is the link
Sorry. I restrict myself to the java TA.
Avatar of _Esam

ASKER

Thanks then....

_Esam