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:
Package not tracable at run time.
Posted by Pawan Garg on September 11, 2000 at 12:28 PM
Hi Samant Can you check a few things: a. Are all the classes in the package created in the package directory? b. If the above is true, can you include this path in the CLASSPATH as follows: SET CLASSPATH=%CLASSPATH%;; then try and run the same. It should work (fingers crossed). Thanks Pawan > 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:
|