- Did you use the 'Eclipse Project importer' module (http://www.netbeans.org/kb/articles/import-eclipse.html) to perform the import?
- nbproject/project.properties has an entry called 'manifest.file' that points to the manifest file being used. Perhaps you can try manually editing the manifest file. (Automatic import would of course be better...) Have you tried editing manifest.file?
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
May 9, 2007 9:57 PM
(reply 3
of 13) (In reply to
#2 )
You should be able to open the manifest file for editing, from the 'Files' tab in the navigator window. Can you try manually editing the file in files view?
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
May 10, 2007 6:54 AM
(reply 4
of 13) (In reply to
#3 )
When I open the file in "files" view, it opens as a read-only file. I opened the files-properties dialog box for the file and did not see an option to make it writable.
I hope I don't need to leave the IDE and use jar from the command line to correct the file, but at this time I don't see another solution.
I don't understand why the manifest file is not being generated correctly.
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
May 10, 2007 10:24 AM
(reply 5
of 13) (In reply to
#4 )
I haven't tried an eclipse import; but when i created a standard project, i notice that manifest.mf is writable and i am able to edit the file in the ide.
One possibility is that the import failed for some reason during some operations (which might have left the manifest in readonly mode). You may want to check the <userdir>/var/log/messages.log file to see if there were any error messages and/or stacktraces that may have been output by the import process.
Or, if you feel the import was more or less okay but may have had some minor issues that can be corrected manually, you may choose to do so. If the changes required are one-time changes, then it would make sense to make manifest writable and edit the changes outside of the ide; and fix other errors as you do.
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
May 12, 2007 8:12 PM
(reply 6
of 13) (In reply to
#2 )
I created a new project, copied my classes to the new project and compiled it. The manifest was generated correctly.
I noted that when I looked in MyProjects\nbproject\.project.properties the main.class=biz.myCompany.myProject.mainClass and
manifest.file=manifest.mf were set correctly.
I wonder what made the project import incorrectly. Perhaps it is the MyEclipse plug-in in eclipse??
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
May 13, 2007 11:35 AM
(reply 7
of 13) (In reply to
#6 )
Glad to know you were able to workaround the problem by manually creating the project.
Regarding the eclipse importer module failing in NetBeans:
- It could be that the eclipse project that you have uses some advanced features of eclipse that are not supported by the importer. (I haven't worked with eclipse so am not aware of MyEclipse plugin...)
- The <nb_user_dir>/var/logs/messages.log is the file where the importer should have recorded any errors that it might have encountered. (It is possible that some errors are not recorded, which would be a bug in the importer module...)
- If you are still interested in diagnosing why the import failed, you may want to file an issue for this: http://qa.netbeans.org/bugzilla/reportbug.html :
component value to be used: ide
subcomponent value to be used: eclipse project import
It would be nice if you can include the original project as an attachment so that engineers can take a look at it.
- Since netbeans is an opensource project, you also have the option of downloading the source and debugging it yourself !! The following are some pointers that have more info on this:
http://nbbuild.netbeans.org/building-netbeans-trunk.html
http://www.netbeans.org/community/sources/
http://www.netbeans.org/source/browse/ide/projectimport/src/org/netbeans/modules/projectimport/
http://www.netbeans.org/community/contribute/
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
Apr 7, 2008 7:32 PM
(reply 10
of 13) (In reply to
#9 )
Hello All!
I've just spent an entire day with a similar problem, after figuring it out i felt i had to share this for anyone else that may find themselves stuck in the same spot.
My Netbeans is version 6.01, and my problem was that, if in the root directory of your project there does not exist a (generic) manifest.mf file, then Netbeans does not generate a manifest.mf file correctly in the build process, and provides a rather blank one in your final jar file. It will have the typical comments, but lacks the Main-Class argument, even thou it is correctly spelled out in the build.xml file. Adding the manifest.mf file to the root of my project folder, caused Netbeans to correctly build my executable jar file correctly.
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 10.0-b19 (Sun Microsystems Inc.)
X-COMMENT: Main-Class will be added automatically by build
p.s. don't forget the last line must be an empty line with carriage return.
Re: Netbeans 5.5 manifest.mf does not contain main, classpath
May 6, 2008 4:28 AM
(reply 12
of 13) (In reply to
#11 )
The problem occurs on different occasions. I had a project started as "Java Class Library" to which I added a main class. The jar would not run and exit with the "Main class not found" error message.
Editinf the project.properties and the manifest file as described solved the problem.