?
Solved

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

Posted on 2005-03-30
39
Medium Priority
?
355 Views
Last Modified: 2013-11-23
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
Comment
Question by:_Esam
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 20
  • 19
39 Comments
 
LVL 37

Expert Comment

by:zzynx
ID: 13660054
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
 

Author Comment

by:_Esam
ID: 13660135
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
Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

 
LVL 37

Expert Comment

by:zzynx
ID: 13660163
>> 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
 

Author Comment

by:_Esam
ID: 13660193
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13660221
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
 

Author Comment

by:_Esam
ID: 13660295
>>>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
 
LVL 37

Expert Comment

by:zzynx
ID: 13660692
>> 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
 

Author Comment

by:_Esam
ID: 13660735
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13660784
>> 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
 

Author Comment

by:_Esam
ID: 13660875
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
 

Author Comment

by:_Esam
ID: 13660896
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13660973
>> 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
 

Author Comment

by:_Esam
ID: 13660988
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661008
>> 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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661013
And you also have java(.exe) in that same directory?
0
 

Author Comment

by:_Esam
ID: 13661017
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
 

Author Comment

by:_Esam
ID: 13661041
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661059
>> This means somehow the path variable is not being set up ??
Indeed.


0
 
LVL 37

Expert Comment

by:zzynx
ID: 13661084
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661087
PATH3 was a typo.
Should have been PATH of course
0
 

Author Comment

by:_Esam
ID: 13661097
So how to solve it?

_Esam
0
 

Author Comment

by:_Esam
ID: 13661112
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661122
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
 

Author Comment

by:_Esam
ID: 13661172

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
 

Author Comment

by:_Esam
ID: 13661187
What is this?
BLASTER=A220 I5 D1 T4 P330
CMDLINE=doskey /insert

_Esam
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13661270
>> 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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661296
>> 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
 

Author Comment

by:_Esam
ID: 13661357
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
 

Author Comment

by:_Esam
ID: 13661374
Looks like I have two PATH vairables ...
Should I delete the first one?

_Esam
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13661428
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661434
Remark for [2]: please ***NO*** space between 'path' and '='
0
 
LVL 37

Expert Comment

by:zzynx
ID: 13661447
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
 

Author Comment

by:_Esam
ID: 13661473
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
 

Author Comment

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

_Esam
0
 
LVL 37

Accepted Solution

by:
zzynx earned 200 total points
ID: 13661521
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
 

Author Comment

by:_Esam
ID: 13661702
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
 
LVL 37

Expert Comment

by:zzynx
ID: 13661755
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
 

Author Comment

by:_Esam
ID: 13661761
Thanks then....

_Esam
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 1 hour left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question