Skip to main content
RISC
  • Home
  • More
English ‎(en)‎
Deutsch ‎(de)‎ English ‎(en)‎
You are currently using guest access
Log in
RISC
Home
Expand all Collapse all
  1. PractSoftTech15
  2. Exercises
  3. Exercise 0 (Won't be evaluated!)

Exercise 0 (Won't be evaluated!)

Completion requirements
Opened: Wednesday, 4 March 2015, 12:00 AM
Due: Wednesday, 11 March 2015, 11:55 PM

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.

You are currently using guest access (Log in)
Data retention summary
Get the mobile app
Powered by Moodle