Blog Archives

Creating and Executing java file in Linux

Before executing ensure java is Installed and Properly configured

Step 1: Create a java file

I have created a java file named OafTraining.java

public class OafTraining
{
public static void main(String args[])
{
System.out.println(“OAF Training”);
}}

Step 2: Compilation of the Java file

Hit the below command to compile the java file

$ javac OafTraining.java

Step 3: To Execute hit the below command in Terminal

$ java -classpath /home/appluat/java_tut OafTraining

 

 

Design a site like this with WordPress.com
Get started