JDK-4380614 : java -version goes to stderr intsead of stdout
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 1.2.2_08,1.3.0,1.3.1,1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,solaris_8,windows_98
  • CPU: generic,x86,sparc
  • Submitted: 2000-10-18
  • Updated: 2015-03-03
  • Resolved: 2012-11-06
Related Reports
Relates :  
Relates :  
Description

Name: krC82822			Date: 10/18/2000


18 Oct 2000, eval1127@eng -- 1.1.8, 1.2.2 and 1.3.0-C all send output to stderr,
despite resolution of bug # 4128736 (among others).

-----------------

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


The 'java -version' output goes to standard error. Why, the version is not an
error? This occurs on all Javasoft 1.3 JDKs.
(Review ID: 111059) 
======================================================================


###@###.### 2001-08-13
java -version goes to stderr intsead of stdout. This problem exists in java 1.1.8, 1.2.2, 1.3.1 and also in 1.4.0-beta_refresh.
As per bug id 4128736 this problem was fixed, but it still exists.

Name: rmT116609			Date: 04/17/2002


DESCRIPTION OF THE PROBLEM :
When executing "java -version" on the JRE 1.4 version the resulting information is sent to standard error instead of standard out.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Load the JRE 1.4
2.  Execute "java -version"

EXPECTED VERSUS ACTUAL BEHAVIOR :
I would expect the output to be sent to standard out not standard error.  This is not consistent with normal unix behavior.  If you run "perl -version" or "showrev" commands they are sent to standard out.

(Review ID: 145516)
======================================================================

Comments
Fixing this would produce an unacceptable incompatibility.
06-11-2012

EVALUATION Reassigning to java/tools since this is a launcher/libraries issue. The -version and -showversion flags are interpreted by the java launcher, and the actual version information is formatted and printed by sun.misc.Version. We should think very, very carefully before ever fixing this bug. It's obviously the wrong thing to print version information to stderr, but since we've been doing that since the beginning of time it seems likely that we'll break existing systems built on top of Java if we change it now. If we do decide to change this then it must wait until the Tiger release so that adequate testing can be done. -- ###@###.### 2001/12/12
12-09-0178