I am getting a NoClassDefFoundError, class file has wrong name, when I try to put HelloWorld in a package! I am using Jamvm v1.5.2. I am assuming my class paths are set correctly because I am able to run when HelloWorld is not in a package... How do I get a main to run inside of a package with jamvm? What path do I need to set for this to work? Thanks.
Hello.java:
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello gumstix.");
}
}
root@overo:~/default# jamvm Hello
Hello gumstix.
Hello.java:
package test.com;
public class Hello
{
public static void main(String[] args)
{
System.out.println("Hello gumstix.");
}
}
root@overo:~/test# jamvm Hello
Exception in thread "main" java.lang.NoClassDefFoundError: Hello
Caused by: java.lang.NoClassDefFoundError: class file has wrong name
Not sure if you have
package test.com;, but if you hadpackage test;try moving the Hello.class file to a folder named "test" and then writefrom directory where yout "test" folder is.
Works on Windows with standart Java SE version, hope it will work for you too.