I have a NetBeans project MyUtility which contains, as you may surmise, methods that I've created to quicken up my coding. I have imported this project as a library into another NetBeans project I am creating using
File > Project Properties > Libraries > Compile > Add Project...
and then selecting the project I want to use as a library (MyUtility). When I'm in the IDE coding my other project, everything works fine. Suggestions are made correctly, and the IDE picks up JavaDoc code I have typed. However, when I try to run a test class in my other project, this happens:
Exception in thread "main" java.lang.NoClassDefFoundError: math/Math at object.Level$TowerGroup.matchesFilterPart(Level.java:161) at object.Level$TowerGroup.matchesFilter(Level.java:135) at object.Level$TowerGroup.access$000(Level.java:113) at object.Level.main(Level.java:257) Caused by: java.lang.ClassNotFoundException: math.Math at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:423) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:356) ... 4 more Java Result: 1
The class Math in the package math is causing the error when I refer to it (that class is in MyUtility). I think I understand why; NetBeans is referencing the sources I have asked it to, but it is not compiling them in the jar file. I tried to fix this by using a dedicated libraries folder, but to no avail.
Can anyone give me a pointer, please?