javac version
I just typed injavac -version on the command line once and found something very funny.
C:\>javac -version
javac 1.5.0_12
javac:no source files
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:noneGenerate no debugging info
-g:{lines,vars,source}Generate only some debugging info
-nowarnGenerate no warnings
-verboseOutput messages about what the compiler is doing
-deprecationOutput source locations where deprecated APIs are u
sed
-classpath <path> Specify where to find user class files
-cp <path>Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path>Override location of bootstrap class files
-extdirs <dirs>Override location of installed extensions
-endorseddirs <dirs>Override location of endorsed standards path
-d <directory> Specify where to place generated class files
-encoding <encoding>Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-versionVersion information
-help Print a synopsis of standard options
-X Print a synopsis of nonstandard options
-J<flag>Pass <flag> directly to the runtime system
If -version is supposed to print the version information why should it display a message for source files? While usingjava -version, it doesn't prompt for class files.
Is this an inconsistency or am I just bored?
[1754 byte] By [
aniseeda] at [2007-11-27 10:29:16]

Written by different teams, I expect. One of which thought -version should only show a version number, and the other that thought it might be nice to display the help text.
I dimly recall -version once not being a switch at all on javac, thus generating the help text to indicate usage. Might be a throwback to that. But I could be completely wrong on both counts there!
> Written by different teams, I expect.
That's a good possibility.
> I could be completely wrong on both counts there!
That doesn't matter - this is a duke distribution thread. ;)
> That doesn't matter - this is a duke distribution
> thread. ;)
Aha. Who's involved in the scam?
> > That doesn't matter - this is a duke distribution
> > thread. ;)
>
> Aha. Who's involved in the scam?
Nobody! I had some dukes and I'm bored. :)
> > > That doesn't matter - this is a duke
> distribution
> > > thread. ;)
> >
> > Aha. Who's involved in the scam?
>
> Nobody! I had some dukes and I'm bored. :)
Furry muff! Duke philanthropy, eh. Btw, don't ever go to dukedollars.com whilst at work - it's not what you might expect (I hope)
C:\source\java\ebanx\rtl\web\WEB-INF\config\properties>java -version
java version "1.4.2_03"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_03-b02)
Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed mode)
C:\source\java\ebanx\rtl\web\WEB-INF\config\properties>javac -version
C:\source\java\ebanx\rtl\web\WEB-INF\config\properties>C:\langs\java\j2sdk1.4.2\bin\javac.exe -version
javac: invalid flag: -version
Usage: javac <options> <source files>
where possible options include:
-gGenerate all debugging info
-g:noneGenerate no debugging info
-g:{lines,vars,source}Generate only some debugging info
-nowarnGenerate no warnings
-verboseOutput messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath <path> Specify where to find user class files
-sourcepath <path>Specify where to find input source files
-bootclasspath <path>Override location of bootstrap class files
-extdirs <dirs>Override location of installed extensions
-d <directory>Specify where to place generated class files
-encoding <encoding>Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
> Btw, don't ever go to dukedollars.com whilst at work
Rember thsi advices.
I am wondering - would I have been tempted to visit that site (even at home) if someone would have not mentioned it to me? ;)
>
> C:\source\java\ebanx\rtl\web\WEB-INF\config\properties
> >java -version
> java version "1.4.2_03"
> Java(TM) 2 Runtime Environment, Standard Edition
> (build 1.4.2_03-b02)
> Java HotSpot(TM) Client VM (build 1.4.2_03-b02, mixed
> mode)
>
> C:\source\java\ebanx\rtl\web\WEB-INF\config\properties
> >javac -version
>
> C:\source\java\ebanx\rtl\web\WEB-INF\config\properties
> >C:\langs\java\j2sdk1.4.2\bin\javac.exe -version
> javac: invalid flag: -version
> Usage: javac <options> <source files>
> where possible options include:
> -gGenerate all debugging
> info
> -g:noneGenerate no debugging
> info
> -g:{lines,vars,source}Generate only some
> debugging info
> -nowarnGenerate no warnings
> -verboseOutput messages about what
> the compiler is doing
> -deprecation Output source locations
> where deprecated APIs are used
> -classpath <path> Specify where to find user
> class files
> -sourcepath <path>Specify where to find
> input source files
> -bootclasspath <path>Override location of
> bootstrap class files
> -extdirs <dirs>Override location of
> installed extensions
> -d <directory>Specify where to place
> generated class files
> -encoding <encoding>Specify character encoding
> used by source files
> -source <release> Provide source
> compatibility with specified release
> -target <release> Generate class files for
> specific VM version
> -help Print a synopsis of
> standard options
> /pre]
Aha! I knew I remembered that from the "dim-and-distant" past
Cheers
> >java -version
> java version "1.4.2_03"
> >javac -version
> javac: invalid flag: -version
So it something that happened after 1.4 :)