|
-
Apr 29th, 2004, 07:24 PM
#1
Thread Starter
Frenzied Member
Exception in thread main{resolved}
This is the error message I get after I compile and then try to run a simple hello world program.
Theres nothing wrong with the syntax.
Heres the error message I get:
Exception in thread "main" java.lang.NoClassDefFoundError: hello
The way I can get this to work is type in the command prompt:
Set CLASSPATH=
and then im able to run the program and it works.(only thing wrong with this is it's temporary)
Here is some info if you need it:
These are my Environment Variables:
Classpath
C:\Sun\AppServer\jdk\lib\tools.jar\ext
Path
C:\Sun\AppServer\jdk\bin
java version 1.4.2_04
java 2 runtime environment, standard edition
Please help me. I have looked everywhere for answers and sources say I have'nt done anything wrong but obviously something is.
Last edited by System_Error; Jun 10th, 2004 at 10:16 AM.
-
Apr 30th, 2004, 03:27 AM
#2
It means it can't find the class you're specifying on the command line.
You can amend that by emptying the classpath (as you did, this causes the JVM to look in the current directory) or by adjusting it to include ".", the current directory.
java -cp "%CLASSPATH%;." hello
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Apr 30th, 2004, 05:40 PM
#3
Thread Starter
Frenzied Member
Thanks for the help, but is there not a way to permanantly set the Classpath?
-
Apr 30th, 2004, 06:06 PM
#4
Somewhere in the control panel...
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
May 7th, 2004, 12:50 AM
#5
Dazed Member
I just usualy run using C:\> java -classpath C:\path; app unless i set my class path in the system configuration editor.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|