Project: JDT
Bug 14120 Main Class problem in JAR export wizard
Reported: 2002-04-18 12:02:12 | Status: resolved fixed

M5 Build --Part 1-- 1. Add a new project called "MyProject" 2. Add a new class to the default package called "MyClass" with main method public class MyClass { public static void main(String[] args) { } } 3. File->Export->JAR File, choose everything from MyProject. 4. Set JAR file to c:\temp\MyTest.jar 5. Press 'Next' twice 6. Browse and choose the only main class: MyClass 7. Click 'Finish' Than the dialog appeared as "JAR creation failed". In the detail section "Main class is not valid" Retyping the Main Class results in "The selected main class is not selected for export or has no main method" --Part 2-- Cancel the export dialog and add a plain text file called 'MyManifest' with following content: Manifest-Version: 1.0 Main-Class: MyClass Now, repeat the export process with only 1 difference: Use MyManifest as manifest file. Everything works fine now.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarpackager/JarPackagerUtil.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/jarpackager/JarPackageData.java