Bootstrap FreeKB - Java - Create a simple Java app in Linux on the command line
Java - Create a simple Java app in Linux on the command line

Updated:   |  Java articles

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

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


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