How to Find Out Your Javac Version

The Java programming language requires the hand-typed Java source code to be compiled into a format that the Java Virtual Machine (JVM) can interpret and to run. This format is called a "byte code" and is created using the Java compiler (javac). It is sometimes important to compile a Java program on a specific version of the JVM. You can type a command on the command-line console to display the version of a Java compiler.

Instructions

    • 1

      Open a command-line console. For Microsoft Windows, click on the "Start" icon in the lower-left corner of the screen. In the list that displays, click on "All Programs," "Accessories" and "Command Prompt." A black-and-white text-entry console screen will appear.

    • 2

      Check the version of Java Virtual Machine installed on the computer. The Java compiler version will have to either match the JVM version, or be of a lower version for the compiled program to operate correctly (this is called "backward compatibility"). Enter "java -version" (without quotes) at the prompt and press "Enter."

    • 3

      Enter "javac -version" (without quotes) and press "Enter." The computer will return the version of the Java compiler on the computer.

    • 4

      Check for Java and Java compiler versions on an Apple Mac computer using its version of the command-line console, called "Terminal." Open "Applications" and "Utilities." Double-click on "Terminal." Query the JVM version by typing "java -version" (without quotes) and pressing "Enter." Check for the version of the Java compiler by typing "javac -version" (without quotes) and pressing "Enter."

Related Searches:

References

Resources

Comments

You May Also Like

Related Ads

Featured