Installing Oracle java on Ubuntu

For this semester I have got Java as one of the subjects, which means one more language to learn. 🙂

All I get to know in class about java is that its a platform independent language, most of the times used to make web applications, more secure and versatile and portable as well. Its syntax has been derived from C and it has taken its OOP feature from C++. So basically its both C and C++ both with little more polished things.

I have just finished installing Oracle java on my Linux  mint system so that I could create web apps in it in coming days. Its very easy and interesting.

Steps to do so:

http://www.wikihow.com/Install-Oracle-Java-JDK-on-Ubuntu-Linux

Now its turn to make programs. One can use different IDEs to build programs in java. But for me its my terminal, in which I love to do such things.

First Hello world program in Java:

public class HelloWorld { 
   public static void main(String[] args) { 
      System.out.println("Hello, World");
   }
}

Save this program anywhere on your system but don’t forget to save it in with the same name as that of class name, as in this case HelloWorld.java

Command to compile:

javac HelloWorld.java

Command to run the same:

java HelloWorld

And we are done!

Leave a comment