Now we learn how to execute java file in Ubuntu and any Linux OS

  • Firstly open the TERMINAL.
  • Then go to the folder which contain the Java file. With cd command
  • This command enter you into the Desktop.
  • After that we go in the folder which is situated on the Desktop. like on my Desktop Java folder is created.
  • After that we compile the Java file with javac command.
  • After the compilation new file is automatically created in same folder with .class extension. 
  • In my Java folder I created Java file with name demo.java extension. 

  • Now we execute the Java file with java command like that and make shore the name of class write whose contain the main method.
  • That name is put which .class extension is used.
 
  • And now you can run the Java file in ubuntu and same Procedure is follow to run Java file in any Linux OS

Comments

AddThis

Popular posts from this blog

Hello World in Java

How to open App Via Notification in Android and Implement PendingIntent