public class Test
{
public static void main(String[] args)
{
System.out.println("Hello world");
}
}
How are you trying to run it?
I have a feeling your CLASSPATH is set to something and doesn't include ".".
--
Of making better designs there is no end,
and much refactoring wearies the body.
*C:\java test*
Hello world
*C:\java Test*
Exception in thread "main" java.lang.NoClassDefFoundError: Test (wrong
name: test)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
--
Thanks in Advance...
IchBin, Pocono Lake, Pa, USA
http://weconsultants.servebeer.com/JHackerAppManager
__________________________________________________________________________
'If there is one, Knowledge is the "Fountain of Youth"'
-William E. Taylor, Regular Guy (1952-)
Sorry I forgot to mention this. Please, *as a beginner*, post your
questions to c.l.j.help and not this group c.l.j.programmer. An look at
you messages closer. It actually tells you what the problem is.
> Sorry I forgot to mention this. Please, *as a beginner*, post your
> questions to c.l.j.help and not this group c.l.j.programmer. An look at
> you messages closer. It actually tells you what the problem is.
I'll keep that in mind next time. Thanks for the tip.
Maybe it's to obvious, but worth trying for a beginner: Before
executing (java Test), compile (javac Test.java). :-)
--
Pszemus
-==[ GG: 1620292 ]==-
-==[ www: www.sarm.w.pl ]==-
-==[ e-mail: psz...@o2.pl ]==-
>Wouldn't java Test be correct, in this case, since the name of the
>class is Test and not test? In any case, I tried both, and recieved
>the same error for each one.
There is no way you would get the SAME error, perhaps a similar error.
In computing, even every comma counts. Please don't paraphrase error
messages.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.