FreeKB - Java Programming Create a simple Java app in Linux
Create a simple Java app in Linux

Create a file named myJavaApp.java.

~]# touch myJavaApp.java

 

Add the following markup to myJavaApp.java.

public class myJavaApp {
   public static void main(String[] args) {
      System.out.println("Hello World");
   }
}

 

Compile myJavaApp. This will create a new file named myJavaApp.class.

~]# javac myJavaApp.java

 

Execute myJavaApp, and "Hello World" should be displayed.

~]# java myJavaApp
Hello World

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter 7335b in the box below so that we can be sure you are a human.




Comments

Web design by yours truely - me, myself, and I   |   jeremy.canfield@freekb.net   |