JDK-4459600 : java -jar fails to run Main-Class if classname followed by whitespace.
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2001-05-16
  • Updated: 2008-10-17
  • Resolved: 2011-05-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
JDK 7
7 b38Fixed
Related Reports
Relates :  
Description
Name: bsC130419			Date: 05/16/2001


java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

If one creates a manifest file where the main class is followed by whitespace
before the carriage return:

Main-Class: test

the jar file cannot be run using the syntax:
java -jar test.jar

This is a bug.  It is very easy to accidentally include whitespace on a line,
especially if the manifest is generated from a batch file:
echo Main-Class: test > manifest.txt

Thanks!
(Review ID: 124491) 
======================================================================
###@###.### 2004-11-11 22:28:01 GMT

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
2004-06-14

WORK AROUND Name: bsC130419 Date: 05/16/2001 Be very careful not to include following whitespace. From a batch file, be sure the redirector immediately follows the class name: echo Main-Class: test> manifest.txt ====================================================================== Use jar utility that comes with JDK/SDK
2004-06-11

EVALUATION Asking the tools team to look into this. Customers work around was to ensure removal of the white space after classname in manifest file. Then again, they could use jar tool and it should create the correct results. ###@###.### 2002-06-18 Will investigate specification of manifest file. ###@###.### 2002-11-14 Deferring investigation. ###@###.### 2003-10-21
2002-06-18