Sunday, August 4, 2013

How to Run Java Program in Linux Terminal


How to Run Java Program in Linux Terminal

Java : "javac filename.java" will compile filename.java. An object file called filename
(without any extension) will be created and it can be run by typing "java filename".

Eg: To Create a java program in Vim Text Editor
Vi myfirstpgm.java

How to Run Java Program in Linux Terminal

A text editor will open type your java code and press Esc and wq finally Terminal Page will open type the following to compile , run and execute.

 javac myfirstpgm.java

 java  myfirstpgm

Out will display after the above command.

How to Run Java Program in Linux Terminal


No comments:

Post a Comment

Linux Tips and tricks,Online Linux Helpers