Check your classpath settings. Most likely you don't have the current directory ('.') in your classpath.
Or if not that, you have a typo somewhere in your classname (remember Java is case sensitive) or you're in the wrong directory (and the directory your classes root in is not in the classpath).
jwenting
duckman
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
when u are running the programm. remember this
u should use
c:\>java (classname which contains main method)
do not type the .java extension when running the file.`
u shud use it only wen u are compiling.
indianscorpion2
Junior Poster in Training
82 posts since May 2005
Reputation Points: 9
Solved Threads: 1
I have checked my enviromental paths and the all check out ok. I tried to run the first program i created for my class. I know this program runs because I checked before I turned it in. THis is the process I use to run the program.
"javac lab1a.java"
I get a clean compile and then input
"java lab1a" after I hit enter it displays
"Exception in thread "main" java.lang.NoClassDefFoundError: lab1a"
just a though, could a virus cause me any problems when trying to run an app? Thanks for your help
first off all please post the source code here.
ok.... just after compiling and before running, u try to search for lab1a.class file in the same directory.
if u do not find it i am afraid the java runtime environment or the JVM is not configured properly.
try reinstalling the JDK.
regarding ur last doubt. the answer is no.
a general virus cannot prevent the execution (running) of a java program normally.
indianscorpion2
Junior Poster in Training
82 posts since May 2005
Reputation Points: 9
Solved Threads: 1
moreover there is another chance that the class file is getting saved somewhere else. so search for it and copy paste it in the directory which u have set as the class path.
then run ur program by using the java lab1a command.
indianscorpion2
Junior Poster in Training
82 posts since May 2005
Reputation Points: 9
Solved Threads: 1