Create Jar File Netbeans 6.8

5/31/2018by
Create Jar File Netbeans 6.8Create Jar File Netbeans 6.8

I have the following problem. I have a Java project in my NetBeans IDE 6.8. When I compile it and it produces a.jar file containing everything possible, the META-INF is not right. It doesn't contain the class to be executed - with main() method. When I click the Run button inside the IDE, everything works.

How To Make An Executable JAR File In NetBeans 3.6 Page 3 of 8 4. The New Wizard screen appears. Click the “+” sign beside “JAR Archives” –>Select “JAR. Point And Click Games. The JAR file is built. To view it inside NetBeans: Click the Files tab; Expand Project name >>dist; Ensure files aren't being excluded when building the JAR file. The options and arguments used in this command are: The c option indicates that you want to create a JAR file. The f option indicates that you want the output to go. The options and arguments used in this command are: The c option indicates that you want to create a JAR file. The f option indicates that you want the output to go.

The settings of the project are also set the right way - pointing to a class in my project. I tried adding a folder META-INF with manifest file but I didn't manage. Is there a way to do this manually in NetBeans, because I found that if I add the missing Main class in the manifest, everything works. (I suppose I hit some sort of bug.) //edit: The result I'm after is that I want the jar that is created with the build of NetBeans to be executable with command: Quote from: When the Main-Class is set in the manifest file, you can run the application from the command line: java -jar app.jar. I'm going to make a summary of the proposed solutions and the one that helped me! After reading this bug report: • Create a manifest.mf file in my project root • Edit manifest.mf. Mine looked something like this: Manifest-Version: 1.0 Ant-Version: Apache Ant 1.7.1 Created-By: 16.3-b01 (Sun Microsystems Inc.) Main-Class: com.example.MainClass Class-Path: lib/lib1.jar lib/lib2.jar • Open file /nbproject/project.properties • Add line manifest.file=manifest.mf • Clean + Build of project Now the.jar is successfully build.

Thank you very much vkraemer. The real problem is how Netbeans JARs its projects. The 'Class-Path:' in the Manifest file is unnecessary when actually publishing your program for others to use. If you have an external Library added in Netbeans it acts as a package.

I suggest you use a program like WINRAR to view the files within the jar and add your libraries as packages directly into the jar file. How the inside of the jar file should look: MyProject.jar Manifest.MF Main-Class: mainClassFolder. Lee Child Jack Reacher Epub S. Mainclass mainClassFolder Mainclass.class packageFolder IamUselessWithoutMain.class.

Comments are closed.