Difference between revisions of "Programming/Java"

From HPC
Jump to: navigation , search
m
m
Line 51: Line 51:
  
 
[http://www.tutorialspoint.com/java/ http://www.tutorialspoint.com/java/]
 
[http://www.tutorialspoint.com/java/ http://www.tutorialspoint.com/java/]
{|
+
 
|style="width:5%; border-width: 0" | [[File:icon_home.png]]
+
==Navigation==
|style="width:95%; border-width: 0" |
+
 
 
* [[Main_Page|Home]]
 
* [[Main_Page|Home]]
* [[Applications|Application support]]
+
* [[Applications|Application support]]  
 
* [[General|General]]
 
* [[General|General]]
* [[Training|Training]]
+
* [[Programming|Programming support]] *
* [[Programming|Programming support]]
 
|-
 
|}
 

Revision as of 10:28, 10 June 2019

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

Further Information

http://www.tutorialspoint.com/java/

Navigation