System Status: All systems are operational • Services are available and operational.
Click for detailed status
Click for detailed status
Java
Java is a high-level, general-purpose, memory-safe, object-oriented programming language. It is intended to let programmers write once, run anywhere.
Java on Euler¶
On Euler the following versions are available via modules:
| Version | Module command |
|---|---|
| 21.0.3 | module load stack/2024-06 openjdk/21.0.3_9 |
| 17.0.8.1 | module load stack/2024-06 openjdk/17.0.8.1_1 |
| 11.0.20.1 | module load stack/2024-06 openjdk/11.0.20.1_1 |
| 8u141-b15 | module load stack/2024-06 jdk/8u141-b15 |
Example program¶
Create a file hello.java, with the content:
Bring java and javac (the java compiler) to the command line with:
Compile the program hello.java:
which produces a file Hello.class. Then run the program with:
and the program should print:
to your terminal.