Never confuse education with intelligence, you can have a PhD and still be an idiot.
- Richard Feynman -



Category:Java tools

From Juneday education
Revision as of 11:26, 9 June 2016 by Henrik Sandklef (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Java comes with a range of tools for different purposes. We will introduce most of them below.

Java Compiler

The Java [compiler] transforms programs written in the Java programming language in to Java bytecode, which can be executed in the JVM.

If you download the Java Development Kit from Oracle, the Java compiler is called javac.

javac

Examples on how to use java:

  • If you want to compile a file called Hello.java you write:
    javac Hello.java
    
  • If you want to compile a file called Hello.java and GoodBye.java you write:
    javac Hello.java GoodBye.java
    
  • If you want to compile a file called Hello.java and GoodBye.java which are found in a packge called com.example you write:
    javac com/example/Hello.java com/example/GoodBye.java
    

Java runtime environment

If you download the Java Development Kit or the Java Runtime Environment from Oracle, the Java runtime environment is called java.

java

Examples on how to use java:

  • If you want to run(or execute) a class file called Hello.java which is found in a packge called com.example you write:
    java com.example.Hello
    
    This invokes the Java runtime environment and loads the class com.example.Hello, which in turn is started via its main method.

Other tools

javah

javap

This category currently contains no pages or media.