Hi friends

I m new to this site.
I have got a problem.
I cant run Java program on my PC.
If anyone can help plz reply.

Check your environment variables:
I posted this in a previous thread:

Considering you have windows:

Goto start--->right click on my computer--->select properties
Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.

The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.

SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:

C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin




Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:

.;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar

Your's will look similar, although you do not need the .;%classpath%.; statement.


Next, you need to know how to access your files at the command line.

To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:

cd/javawork // brings me to the right directory
javac Hello.java //compiles my program
java Hello //runs my program


Let me know if you don't undestand something or need more help.

Hi everyone,

Check your environment variables:
I posted this in a previous thread:

Considering you have windows:

Goto start--->right click on my computer--->select properties
Goto the advanced tab, and you should see a button at the bottom that says environment variables...click on that.

The only thing you need to worry about is the PATH variable, and the CLASSPATH variable, nothing else.

SKIP THIS STEP AND GO ON TO THE CLASSPATH, IF IT DOESN'T WORK AFTER SETTING THE CLASSPATH, THEN COME BACK AND SET THIS.
The path variable must point to the bin folder in the sun app server, and the bin folder in the jdk directory. Now, those are two different directories, so you seperate them with a semicolon when creating it. Here is what mine looks like:

C:\Sun\AppServer\bin;C:\Program Files\Java\jdk1.5.0\bin




Classpath....This points to the tools.jar file in the jdk directory. It's pretty easy to find. Here is what mine looks like:

.;%classpath%.;C\Program Files\Java\jdk1.5.0\lib\tools.jar

Your's will look similar, although you do not need the .;%classpath%.; statement.


Next, you need to know how to access your files at the command line.

To do so, you simply type cd/folderName at the command line. The cd stands for current directory. My folder was named javawork, so to access it, I did this at the command prompt:

cd/javawork // brings me to the right directory
javac Hello.java //compiles my program
java Hello //runs my program


Let me know if you don't undestand something or need more help.

I could not have said it better myself

Richard West

Hi
Thanx for a reply.I hav already tried to set the path and the classpath. But its still not working.by the way
My path is: c:\matlab\bin;c:\bin;C:\Program Files\ESTsoft\ALZip\;C:\Program Files\Java\jdk1.5.0\bin
& the classpath is:"C:\Program files\java\jdk1.5.0\lib\tools.jar"

I could: see the installation instructions ;)

Dont be a party pooper!


Anyways, try adding a period to the end of the classpath:

C:\Program files\java\jdk1.5.0\lib\tools.jar.


Get it. Got it. Good.

did it work?

Thanx for ur help but it havnt worked yet.
I dont know what the hell is the problem here.
It did work one yr back but now i m unable to work it out. :sad:
anyways thanx.

You should have let me know that it still wasn't working. These problems can take a while to fix.

Now, if you tried putting the period at the end of the .jar extension(.jar.) and it didn't work, try adding this at the VERY beginninng:

.;%classpath%.;

You should have let me know that it still wasn't working. These problems can take a while to fix.

Now, if you tried putting the period at the end of the .jar extension(.jar.) and it didn't work, try adding this at the VERY beginninng:

.;%classpath%.;

Hi

Thanx a lot dear for trying to help me.
Ayways after replying u i tried it again n had it done already.
I hav already done what u hav suggested n its working now.
Thanx alot again.

Bye

Hi Manisha i am also new to this site you have to set u r classpath.
for eg if you have saved u r program as C:\abc\ then set path to this folder as set path=C:\j2sdk1.4.1\bin; and set calsspath=;.; then u r program will work.

Hi friends

I m new to this site.
I have got a problem.
I cant run Java program on my PC.
If anyone can help plz reply.

how to set class path ???
can ne1 help me out

coz i tried and it doesnt work

though when i save the code in bin and un it form there itz executes
why is this so ?

c:\java2_13\bin ?
so whtz the proper setpath and classpath i shld give in command

ey thx problem solved
sum1 mention use echo set path dont know wht it is
but it helped me a lot to solve my query

set path=%path%;c:\j2......\bin
this helped me a lot
thank you alll
problem solved

This article has been dead for over six months. Start a new discussion instead.