Can't run classes in packages
Posted: Tue Feb 23, 2010 8:20 pm
I recently switched to Windows 7, and now, after moving all my Java programs over, my classes in packages will no longer run. I can access them, but if my main method is in a class in a package, I get the following a NoClassDefFoundError.
I've tracked the problem down to the fact that the parameters field for my "Run Java Application" tool is just $BaseName, so that it is effectively calling
when java is expecting
I've tried using the latter from the command line and it works.
Is there any way to get get TextPad to include the package, or to convince java that it doesn't need it?
Code: Select all
package MyPackage;
public class MyClass{
public static void main(String[] args){
System.out.println("1");
}
}Code: Select all
Exception in thread "main" java.lang.NoClassDefFoundError: MyClass (wrong name: MyPackage/MyClass)"Code: Select all
java MyClassCode: Select all
java MyPackage.MyClassIs there any way to get get TextPad to include the package, or to convince java that it doesn't need it?