Exercise 0 (Won't be evaluated!)
Install a JDK
Make sure that there is an existing JDK installation on your machine. Use your package manager or download it, e.g. from Oracle:
http://www.oracle.com/technetwork/java/javase/downloads/index.html
Execute the command java -version
If the version number is less than 1.6.0 then install a more up-to-date version.
Create a file HelloWorld.java
Create a file HelloWorld.java which contains the following source code:
class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
Compilation and Execution
Enter into the directory where the file HelloWorld.java is located
and type the following command in the command line for compiling the
java source code:
javac HelloWorld.java
If everything goes smoothly you will not get any error message and you can find a file HelloWorld.class in the same directory.
You can start the program with the following command:
java HelloWorld
The result/output should be the text „Hello World!”.
Upload the file in Moodle
Upload the file HelloWorld.java in Moodle.