This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 222649 - Main class was not added to manifest
Summary: Main class was not added to manifest
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Compiler (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Dusan Balek
Depends on:
Reported: 2012-11-23 10:09 UTC by rafo
Modified: 2012-11-23 11:06 UTC (History)
0 users

See Also:
Exception Reporter:

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.