participate


Sun Java Studio Enterprise - Netbeans 5.5 manifest.mf does not contain main, classpath
<<   Back to Forum  |   Give us Feedback
10 Duke Stars available
This topic has 13 replies on 1 page.
icesurfer
Posts:18
Registered: 3/3/07
Netbeans 5.5 manifest.mf does not contain main, classpath   
May 8, 2007 3:42 AM

 
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?
 
KarthikR
Posts:1,118
Registered: 10/27/97
Re: Netbeans 5.5 manifest.mf does not contain main, classpath   
May 8, 2007 10:56 AM (reply 1 of 13)  (In reply to original post )

 
- 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?
 
icesurfer
Posts:18
Registered: 3/3/07
Re: Netbeans 5.5 manifest.mf does not contain main, classpath   
May 9, 2007 7:03 PM (reply 2 of 13)  (In reply to #1 )

 
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.
 
KarthikR
Posts:1,118
Registered: 10/27/97
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?
 
icesurfer
Posts:18
Registered: 3/3/07
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.
 
KarthikR
Posts:1,118
Registered: 10/27/97
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.
 
icesurfer
Posts:18
Registered: 3/3/07
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??

icesurfer.
 
KarthikR
Posts:1,118
Registered: 10/27/97
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/
 
Technologicus
Posts:1
Registered: 5/9/07
Re: Netbeans 5.5 manifest.mf does not contain main, classpath   
Jul 4, 2007 12:28 PM (reply 8 of 13)  (In reply to #6 )

 
Try setting the main class ( under Project node -> Properties -> Run -> Main Class ) after importing but before your first build.
 
EvilPotato
Posts:1
Registered: 3/11/08
Re: Netbeans 5.5 manifest.mf does not contain main, classpath   
Mar 11, 2008 6:32 AM (reply 9 of 13)  (In reply to original post )

 
I had the same issue when importing from JBuilder, the same solution worked for me. Thanks.
 
MIjavaGuy
Posts:1
Registered: 4/7/08
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.

Hope this helps.
 
-flick-
Posts:1
Registered: 3/7/04
Re: Netbeans 5.5 manifest.mf does not contain main, classpath   
Apr 13, 2008 1:43 PM (reply 11 of 13)  (In reply to #10 )

 
Yeah that, and also I needed to add the following line in project.properties (File view):

manifest.file=manifest.mf

The line comes after "main.class=".

Hope that helps in fixing the problem.
 
tango1383
Posts:14
Registered: 7/29/05
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.

Thanks for the input.
 
bhavishya
Posts:149
Registered: 9/24/08
Re: Netbeans 5.5 manifest.mf does not contain main, classpath   
Jul 30, 2009 10:29 PM (reply 13 of 13)  (In reply to #10 )

 
hi
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.
 
This topic has 13 replies on 1 page.
Back to Forum
 
Read the Developer Forums Code of Conduct

Click to email this message Email this Topic

Edit this Topic
  
 
 
Forums Statistics
    Users Online : 27
  • Guests : 128

About Sun forums
  • Oracle Forums is a large collection of user generated discussions. It is here to help you ask questions, find answers, and participate in discussions.

    Check out our guide on Getting started with Oracle Forums for a full walkthrough of how to best leverage the benefits of this community.

Powered by Jive Forums