quinta-feira, 22 de agosto de 2013

Could not find or load the default class

Hey!
How are you doing?
If you are like me, trying to remember how to configure youre machine to start programmin in JAVA, that's how your enviromental variables must look like bellow:
CLASSPATH = .;C:\Program Files\Java\jdk1.7.0_21\bin

JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21

Path= %JAVA_HOME%\bin
Attention:
Avoid redundance of javas
For instance, my windows has JDK 1.7, JRE 1.6 and JRE 1.7.
If your machine was set for programming, use only jdk. Otherwise your gonna receive messages that are variations of that one
"Could not find or load the default class" - very irritating message.














And to be sure you are using the right version go DOS command line and type
java -version
The result in my case is
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) Client VM (build 23.21-b01, mixed mode, sharing)
You must be absolutely right about the javac and java. Both must be from the same version or, when you try to run you .class file, you're gonna receive an error message.
And that's all folks!


Nenhum comentário:

Postar um comentário