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
In 7.3 just enable Properties/Build/Package/Copy Dependent Libraries and main class will be added to manifest when building depending on selected target.
Adding manifest.file=manifest.mf into project.properties and creating manifest.mf file in the project directory works fine in NB 6.9 and should work also in NB 6.8.
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.Mainclass
mainClassFolder
Mainclass.class
packageFolder
IamUselessWithoutMain.class
Brother you don't need to set class path just follow these simple steps (I use Apache NetBeans)
Steps:
extract the jar file which you want to add in your project.
only copy those packages (folder) which you need in the project. (do not copy manifest file)
open the main project jar file(dist/file.jar) with WinRAR.
paste that folder or package in the main project jar file.
Those packages work 100% in your project.
warning: Do not make any changes in the manifest file.
Another method:
we need to move lib folder in dist folder.then we set class path from manifest.mf file of main jar file.
Edit the manifest.mf And ADD this type of line
Warning: lib folder must be inside the dist folder otherwise jar file do not access your lib folder jar files