If you have a clean Ubuntu installation on your Desktop or in the Amazon Cloud (AWS EC2) the procedure is the same.

First, open the the Terminal or log into your EC2 instance.

First, we have to update apt-get because this is not up to date in this version.

Then we have to install the OpenJDK 7

After the installation, we have to create a new file called bash_profile. This will be used to set variables at the start up.

Then put this in your file, or wherever your Java version is installed. But be aware that you do not add /bin to JAVA_HOME or JRE_HOME variable, this is done by the system. Add it just in the PATH variable.

Now restart your Instance and you will see, java is installed 🙂



Install OpenJDK 7 on Ubuntu 12.04 (also in AWS EC2)
Tagged on:             

One thought on “Install OpenJDK 7 on Ubuntu 12.04 (also in AWS EC2)

  • August 13, 2017 at 11:46 am

    I tried above steps but getting below error while executing

    Package openjdk-7-jre is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or


Leave a Reply


Get every new post on this blog delivered to your Inbox.

Join other followers:

Welcome Damir Kusar

Log in

Lost your password?
%d bloggers like this: