This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
code compiles even when the package name wrong The package name is 'test' and appears in the source code as 'Test'. The file compiles and when it runs, produces: run: java.lang.NoClassDefFoundError: test/TestClass (wrong name: Test/TestClass) at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:621) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at java.net.URLClassLoader.access$000(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:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: test.TestClass. Program will exit. Exception in thread "main" Exception in thread "main" Java Result: 1 ============== package Test; class Coffee { enum EnumClass { ONE, TWO, THREE } public EnumClass attribute; } public class TestClass { public static void main(String[] args) { } }
This is already reported as issue 146168. Thanks for your report anyway *** This issue has been marked as a duplicate of 146168 ***