PDA

View Full Version : java program not run


Amir.php
17-02-2008, 10:07 AM
i recently installed jdk1.6.0_04 on my winxp system.
Any program i compile, they compile succesfully but when i try to run the following error appeares on cammand prompt(please the attachement) .
please help.
Also please tell me to set path and class path in java.

ruturaj3
17-02-2008, 11:37 AM
First reinstall the jdk again.

And save all your programs in other folder, not where jdk is installed.

You can use set path command , but u will need to type it each time u open the cmd prompt. Else u can set path in enviroment variable only once(No need set it again).

Command is :

set path = "X:\Folder_name\bin"
eg. set path = "C:\jdk1.6\bin"

where, X is drive where u hv installed jdk & folder_name is folder name in which jdk is installed.
U can verify whether path is set or not by using command , path.

For enviromental varible :

My computer -- RClick -- Properties -- Advanced --Environment variables -- System variables -- Path -- Edit -- In variable value field -- after the last word if there is a no semicolon type ; else not.
After the semicolon type the path.
eg. ;C:\jdk1.6\bin

Then press ok.

Reopen the cmd prompt and try javac , java command without any file name
it will show u all the options related with commands.

Now compile & run ur programs.

Happy Programming :)

Amir.php
17-02-2008, 12:40 PM
returaj3 i have done all you tell me but same error is also appeared.
i think error of because of no class path set . please solve this problem.

T159
17-02-2008, 12:48 PM
returaj3 i have done all you tell me but same error is also appeared.
i think error of because of no class path set . please solve this problem.

here is a link to my blog about beginners approach to java, it has all the screenshots and a working tutorial, hope it helps:

http://visio159.wordpress.com/category/java/

redhat
17-02-2008, 01:36 PM
@Amir.php : Youre error is the same as this thread already running:
http://www.thinkdigit.com/forum/showthread.php?p=749983

Zeeshan Quireshi
17-02-2008, 05:07 PM
Your Java Classpath is not set properly .

Here's the tutorial to set-up classpath:

http://java.sun.com/j2se/1.3/docs/tooldocs/win32/classpath.html