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

 

 

Unknown's avatar

About pacesettergraam

A good and realistic person

Posted on December 17, 2019, in Java and tagged , , . Bookmark the permalink. Leave a comment.

Leave a comment

Design a site like this with WordPress.com
Get started