-version with java and javac
The -version
option can be used with both java
开发者_运维百科 and javac
. Whats the difference?
Each reports the version of the program it's running. java
(the Java virtual machine) and javac
(the Java compiler) are separate programs. It would be perfectly possible to have your path set up so that they weren't from the same installed package... and anyway, it's handy to be able to be absolutely sure that you've got the right version when you run something.
Java:
jonathan@bespin:~$ java -version java version "1.6.0_16" Java(TM) SE Runtime Environment (build 1.6.0_16-b01) Java HotSpot(TM) Server VM (build 14.2-b01, mixed mode)
Javac:
jonathan@bespin:~$ javac -version javac 1.6.0_16
精彩评论