Translate

Saturday, 6 February 2016

HOW TO RUN A JAVA PROGRAM IN UBUNTU

problem:How to run a java program in ubuntu?

Solution: Open JDK is the best.It's simple and i never got any problem with this.

Steps: 
1. Install open jdk using terminal 
 sudo apt-get install openjdk-7-jdk

2. now write your program and save it as filename.java

3. for compilation :
 javac filename.java

4. for run there are two cases:

case 1. if your class containing main() method is public then
 java filename

case 2. if your class containing main() method is not public then 
 java classname

No comments:

Working With Java Collections