Re: netbeans doesn't create lib directory under dist
I think the solution is in front of my nose but I can't see it.
I'm running NetBeans 6 (beta) (with Java 6u3) but I tried the process anyway;
it really hasn't changed.
First, I reviewed NetBeans's documentation on how to deploy an application.
To a project called "testit", I added the log4j library as a NetBeans library
(menu "_T_ools / _L_ibraries"). Did a project "Clean and Build". This
created a dist/ subdirectory within my project directory.
$ ls dist
lib README.TXT testit.jar
$ ls dist/lib
I think the key was the "Clean" part of "Clean and Build". Doing just a
"Build" (it was a pre-existing project) didn't create either JAR file.
Bear in mind that these JARs must deploy together, in the same relative
Then I examined testit.jar.
$ cd dist
$ jar tf testit.jar
Contents of META-INF/MANIFEST.MF:
$ jar xf testit.jar META-INF/MANIFEST.MF
$ cat META-INF/MANIFEST.MF
Ant-Version: Apache Ant 1.7.0
Created-By: 1.6.0_03-b05 (Sun Microsystems Inc.)
X-COMMENT: Main-Class will be added automatically by build
$ java -jar testit.jar
2007-10-08 17:53:55,708 ERROR testit.PolyMatrix : Didn't initialize entire matrix [main ]
I have no CLASSPATH envar defined, not that it would matter.
Code snippet to show the log4j call:
mat    = BigInteger.ZERO; // line 81
catch ( NullPointerException exc )
logger.error( "Didn't initialize entire matrix", exc );
Only the outer dimensions of 'mat' were initialized, causing a reference to
the third dimension to throw the NPE. The NPE was intentional, to show use of