Difference between revisions of "Programming/Java"
From HPC
m |
m |
||
Line 26: | Line 26: | ||
The following modules are available: | The following modules are available: | ||
− | * module | + | * module add java/jdk1.7.0_80 |
− | * module | + | * module add java/jdk1.8.0_102 |
Line 39: | Line 39: | ||
<pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | <pre style="background-color: black; color: white; border: 2px solid black; font-family: monospace, sans-serif;"> | ||
− | [username@login01 ~]$ module | + | [username@login01 ~]$ module add java/jdk1.7.0_80 (or module add java/jdk1.8.0_102) |
[username@login01 ~]$ javac MyFirstJavaProgram.java | [username@login01 ~]$ javac MyFirstJavaProgram.java |
Revision as of 14:57, 7 February 2017
Contents
Programming Details
Java is a high-level programming language originally developed by Sun Microsystems and released in 1995.
Java runs on a variety of platforms, including Viper (LInux), Windows, and Mac OS.
Programming example
public class MyFirstJavaProgram { /* This is my first java program */ public static void main(String []args) { System.out.println("Hello World"); // prints Hello World } }
Modules Available
The following modules are available:
- module add java/jdk1.7.0_80
- module add java/jdk1.8.0_102
Compilation
The program would be compiled in the following way, which a choice Java JDK available.
- Javac - is the JAVA byte compiler
- Java - is the JAVA runtime
[username@login01 ~]$ module add java/jdk1.7.0_80 (or module add java/jdk1.8.0_102) [username@login01 ~]$ javac MyFirstJavaProgram.java [username@login01 ~]$ java MyFirstJavaProgram Hello World