Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 222649 - Main class was not added to manifest
Main class was not added to manifest
Status: NEW
Product: java
Classification: Unclassified
Component: Compiler
PC Windows 7 x64
: P3 (vote)
Assigned To: Dusan Balek
Depends on:
  Show dependency treegraph
Reported: 2012-11-23 10:09 UTC by rafo
Modified: 2012-11-23 11:06 UTC (History)
0 users

See Also:

Sample project that shows the bug (92.01 KB, application/x-zip-compressed)
2012-11-23 10:20 UTC, rafo

Note You need to log in before you can comment on or make changes to this bug.
Description rafo 2012-11-23 10:09:10 UTC
Netbeans does not generate correct manifest file for a plain java project.

When my project has built, there is jar file generated. But its manifest file contains the following information.

****** Mainfest file start *****

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.4
Created-By: 1.7.0_05-b05 (Oracle Corporation)
Class-Path: lib/log4j-1.2.17.jar
X-COMMENT: Main-Class will be added automatically by build

****** Mainfest file end *****

As you may notice, main class is not specified.
Comment 1 rafo 2012-11-23 10:20:53 UTC
Created attachment 128301 [details]
Sample project that shows the bug

I've added a sample Netbeans project that demonstrates the bug I described.

"dist" folder contains incorrect jar-file.
Comment 2 rafo 2012-11-23 11:06:17 UTC
It is not an error, but a feature request.

If a project contains one or more classes with public static void main(String[]) methods, then add a warning to notify a user to add main class to the project settings. Or let the developer suppress this warning when necessary.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo