This content has been marked as final. Show 13 replies
- 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?
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.
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?
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.
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.
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??
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:
Try setting the main class ( under Project node -> Properties -> Run -> Main Class ) after importing but before your first build.
I had the same issue when importing from JBuilder, the same solution worked for me. Thanks.
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.
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.
Hope this helps.
Yeah that, and also I needed to add the following line in project.properties (File view):
The line comes after "main.class=".
Hope that helps in fixing the problem.
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.
Thanks for the input.
as you say to add line in manifest.but i am not able todo this it is saying it is read only file plz tell me correct reason behind it.