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.
My Java SE project depends on libraries from two other (Java SE) projects. I created NB projects for the two library projects (one with existing Ant script and one without) and used the library manager and the project Properties panel to establish the dependencies between my project and the other two. Everything compiles without error message and runs fine in the IDE. The IDE also creates a dist folder with a readme.txt that tells me to execute java -jar /dist/xyz.jar -- but the runtime says it is missing lots of classes that (according to the manual) should all be in dist/lib/! But neither is this directory created, nor was there an error message about why not. The readme.txt mentions at the very end... "If the classpath contains a folder of classes or resources, none of the classpath elements are copied to the dist folder." Aha! But why does it create the JAR file then, if the file cannot possibly work? The readme.txt is more confusing than helpful. What about a more explicit hint (in the build output?), "To automatically create a distributable file, make sure _all resources_ are JARs" or so? This would have saved me a lot of time. PS: By the way, why is it not possible for the build script to wrap all my resources (images, binary data files, classes) into JARs automatically?
Please could you exactly describe the project dependency tree and steps to reproduce? Because what you describe is supposed to work. I mean having project A depending on project B and C, where B and C contain sources of libraries required by A. Then build of project A would copy products of B and C into dist/lib of A. Thanks
Here are detailed instructions that I followed to set up the projects. http://www.jmonkeyengine.com/wiki/doku.php?id=setting_up_netbeans_5.0_to_build_jme_and_jme-physics_2 It was me who added the paragraph at the end of this wikipage about /dist/lib/ not getting created. When I create JARs myself as I describe there, /dist/lib/ gets created, but the executable still doesn't work. If you can give me a hint I will update the wiki page to reflect the best solution. Hope that gives you a picture. FYI, my project does contain non-Java binary resources such as images. I had assumed this was a pretty standard case and it should work, but this line "If the classpath contains a folder of classes or resources, none of the classpath elements are copied to the dist folder." suggests that it doesn't work "out of the box".
Re: "If the classpath contains a folder of classes or resources, none of the classpath elements are copied to the dist folder." If you rephrase that line, does it mean that "only JARs are copied"? The main project's resources do end up inside the main JAR created (which is fine). Only resources in referenced libraries are the problem, they are not copied to /dist/lib/. I looked at my the libraries I use and the non-JAR resources are: *.dll, *.so, *.jnilib, *.dylib All other files required are *.jar. And as I said, if I copy them manually to /dist/lib/, the distributable JAR works fine. So is it possible to write the standard "dist" ant target in a way that it also automatically copies these native libraries mentioned above into /dist/lib/?
I came across a similar error in NB6.0 and then i noticed that in the compile-time libraries list (ptoject properties | libraries panel), there was a non-existent library. When i removed the library, the lib directory was created properly. (If this is not the case with this issue, please update this bug and i will create a separate entry). The problem seems to be with copyLibs task; when it encounters an error it seems to abort the entire operation. Regarding the readme file, i agree that it is very unclear. In fact, improving readme's clarity should probably be a separate P2 bug.
issue is not mac specific.
The problem with a broken reference should be fixed. the copylibs task should work even when there are broken libs when the project is buildable.
> Regarding the readme file, i agree that it is very unclear. In fact, improving readme's clarity should probably be a > separate P2 bug. A P2 issue http://www.netbeans.org/issues/show_bug.cgi?id=108062 has been created for this.
Three years and counting for such a simple bug...