This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
you are executing the class incorrectly....
Posted by Jeff Kinsey on September 04, 2000 at 9:36 AM
when you try to run "c:\com\sss\frm>java Slate", your java runtime environment thinks you are trying to invoke the class "Slate.class" instead of "com.sss.frm.Slate.class". If you run: java com.sss.frm.Slate your class should run. > Please Help. I am exhausted > ---------------------------- > path=%PATH%;c:\jdk\bin; > Environmantal variable SET CLASSPATH=.;c:;
> c:\>java -version > java version"1.2" > classic VM(build JDK 1.2-v, native threads) > > package com.sss.frm; > import javax.swing.*; > import java.awt.*; > import java.awt.event.*; > class Slate extends Jframe{.................................} > c:\com\sss\frm> javac Myframe.java > (my compiled class is in dir c:\com\sss\frm) > c:\> java Slate > Exception in thread "main" java.langNoClassDefFoundError: Slate > > c:\com\sss\frm>java Slate > Exception in thread "main" java.langNoClassDefFoundError(wrong name: com/sss/frm/Slate) > at java.lang.ClassLoader.defineClass0(Native Method); > at java.lang.ClassLoader.defineClass(ClassLoader.java:403) > at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:101) > .......................................................................... > .......................................................................... > > If the package definition is made into a comment (blocked) and then compiled. > The class executes as desired in its own directory. > > I cannot gather where I am erring. > Yours samant S.
Replies:
|