JDK-4219994 : jar command line option to specify a main-class (without manifest file)
  • Type: Enhancement
  • Component: tools
  • Sub-Component: jar
  • Affected Version: 1.2.0,1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic,windows_nt
  • CPU: generic,x86
  • Submitted: 1999-03-12
  • Updated: 2006-11-17
  • Resolved: 2006-11-17
Related Reports
Duplicate :  
Description
Name: dbT83986			Date: 03/12/99


I'd like to be able to create a jar file with a main-class
without having to make up a manifest file. I'm not sure if 
this option should be made incompatible with having a manifest 
file, or if the specified main class should override any
main class in the maifest file (if any).

That way, I can make up a single standalone app, and

javac *.java
jar cMf TestClass Test.jar *.class

and have a ready-to-go .jar file
(Review ID: 53831)
======================================================================

Name: jl125535			Date: 01/28/2003


The current process is also error-prone. You have to manually create a manifest 
file, specify a main class there, then use the m option to include the 
hand-created manifest with the resulting jar file.  Any typos in the manual 
manifest will cause problems.
(Review ID: 159516)
======================================================================

Comments
WORK AROUND Name: dbT83986 Date: 03/12/99 Just write the manifest file. It's only two lines: Manifest-Version: 1.0 Main-Class: TestClass ======================================================================
11-06-2004

EVALUATION Don't want to complicate the launcher in any way that could be resolved very easily using the JAR tool itself. ###@###.### 1999-03-16 I think you should reconsider this. The workaround is clunky. Many users who want the convenience of aggregating their classes and resources should not have to learn the manifest file structure. michael.mcmahon@ireland 2001-03-22
22-03-2001