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.
Product Version = NetBeans IDE 7.0 (Build 201104211303) Operating System = Windows XP version 5.1 running on x86 Java; VM; Vendor = 1.6.0_25 Runtime = Java HotSpot(TM) Client VM 20.0-b11 Pas de problème si ajout d'une bibliothèque standard ("Ajouter une bibliothèque...") Problème si ajout d'un projet ("Ajouter un projet...") Problème si ajout d'u fichier JAR ("Ajouter un fichier JAR ou un dossier..."). Description du problème : L'application tourne normalement dans l'IDE ("Exécuter le projet principal (F6)"). Le lancement par le fichier JAR généré dans le dossier "dist" par "Nettoyer et construire le projet principal" provoque l'erreur "Could not find the main class : xxx.xxx". Program will exit." Rappel, le fichier JAR lance correctement l'application si aucune biliothèque n'est ajoutée ou si les biliothèques ajoutées font partie des Bibiothèques globales.
First of all, please use English while reporting issues against NetBeans, thanks in advance. simple translation by google translator : ------------------ No problem if adding a standard library ("Add Library ...") Problem if adding a project ("Add Project ...") Problem if u add the JAR file ("Add JAR file or folder ..."). Problem Description: The application normally runs in the IDE ("Run main project (F6) "). The launch of the generated JAR file in the folder "dist"with "Clean and build the main project "causes the error" Could not Find the Hand class: xxx.xxx. "Program Will Exit." Recall, the JAR file launches the application correctly if no driver DLL is added or added if the libraries are part of the bookcase overall.
Please excuse me for the use of the French language. I was misled by the report form, itself in French. I would like to specify the translation of the two last paragraphs: The launch of the generated JAR file in the folder "dist" with "Clean and build the main project" causes the error "Could not Find the Main class: xxx.xxx. Program Will Exit." Reminder, the JAR file launches correctly the application if no library is added or if the added libraries are part of Global Libraries.
The presence of the library jar on the classpath has no effect on how the application is executed (at least for the j2se project). It just executes java -cp classpath main_class using the Ant java task. I suppose the project is a J2SE application project, right? The main class exists in the main project (it's not a part of added jar), right? Can you attach the ant verbose output? Or at least send it by email if the name of main class and jars is confident. Thanks You can generate the ant verbose output by setting the Verbosity Level to verbose in the Tools/Options/Miscellaneous/Ant tab. Thanks!
Created attachment 108548 [details] The ant output
Created attachment 108549 [details] The ant output
Thank you for your fast answer. Yes, the project is a J2SE application project. Yes, the main class exists in the main project. I have set the verbosity level on Detailed, I attach the ant output.
Can you also attach the ant verbose output of the "Run Application" when it failed. The compile is not enough the run will contain the java command line used to execute the process. Thank you!
Created attachment 108550 [details] The zip of the dist folder The application normally runs in the IDE. It doesn’t when I attempt to run this application from the command line without Ant. I attach the zip of the dist folder.
Created attachment 108573 [details] The original file of the Project BiblioFormat Continuation of the experiments: The Library file (BiblioFormat.jar) in the folder dist\lib of the main project (Pharmacie) is not readable: jar xf "..\..\dist\lib\BiblioFormat.jar" java.lang.IllegalArgumentException at java.util.zip.ZipInputStream.getUTF8String(ZipInputStream.java:311) at java.util.zip.ZipInputStream.getFileName(ZipInputStream.java:436) at java.util.zip.ZipInputStream.readLOC(ZipInputStream.java:255) at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:82) at sun.tools.jar.Main.extract(Main.java:850) at sun.tools.jar.Main.run(Main.java:242) at sun.tools.jar.Main.main(Main.java:1149) The original file ( BiblioFormat.jar) of the Project BiblioFormat in the dist folder is perfectly readable (see the attachment OriginalJar.zip). I thus copied this file in the directory dist\lib of the main project; then no more error, and I was able to run Pharmacie.jar from command line. Conclusion: it seems that an error occurs at the time of the generation of the pack of distribution during the copy of jar files indicated as libraries.
Seems as a problems with French characters. Can you please try to change following line in the Pharmacie/nbproject/build-impl.xml: <copylibs compress="${jar.compress}" index="${jar.index}" ..... to <copylibs rebase="no" compress="${jar.compress}" index="${jar.index}" ..... (the rebase="no" was added). Does it help? Thanks
If it helps I will try to find some nicer fix :-)
Yes, the proposed change corrects, indeed, the error. Thank you. However, the previous versions of NetBeansIDE had not this problem.
Thanks for testing. The change of build-impl.xml is definitely not a fix. I've just wanted to verify the case. I am now able to reproduce it locally. Thanks you very much for the help!
Fixed jet-main e3079fa592f4 Hopefully fixed. I've also added simple way how to turn off the rebase jet-main b94121c462da
Integrated into 'main-golden', will be available in build *201106021001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/e3079fa592f4 User: Tomas Zezula <tzezula@netbeans.org> Log: #198924:Problems during library additions
Integrated into 7.0.1 b5acd512bc26, 4e44b7e2d1d1