Netbeans 5.5 manifest.mf does not contain main, classpath
I imported an project from Eclipse to NetBeans 5.5. In Eclipse, I would update manifest.txt before I exported the jar and it worked correctly.
When I build the project the manifest.mf contains only:
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.6.5
Created-By: 1.6.0_01-b06 (Sun Microsystems Inc.)
No Main-Class: , Class-Path: or other manifest files.
Project -> Properties -> Run contains package.MyMain Class
What did I miss when I imported the file?
[509 byte] By [
icesurfera] at [2007-11-27 3:41:03]

# 1
- 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?
# 2
I imported the project from Eclipse using the "Eclipse Project Importer"
When I checked the nbproject/project.properties file, I found no reference to any manifest* entry.
I could not find a way to change the build\meta.inf\manifest.mf file from the IDE, it opened as a read-only file.
Additional suggestions would be appreciated.
# 3
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?
# 4
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.
# 5
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.
# 6
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?
icesurfer.
# 7
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/module s/projectimport/
http://www.netbeans.org/community/contribute/
# 8
Try setting the main class ( under Project node -> Properties -> Run -> Main Class ) after importing but *before* your first build.