6 fixed broken link
source | link

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 downloadOracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the command java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using another java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the command java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using another java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the command java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using another java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

5 Fixed some grammars.
source | link

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the commandocommand java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using a otheranother java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the commando java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using a other java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the command java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using another java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

4 Extract tar.gz with sudo, otherwise there will be an error if one is not logged as root
source | link

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the commando java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using a other java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed.
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the commando java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using a other java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

To install the Java Runtime Environment (JRE) run the following command:

sudo apt-get install openjdk-7-jre

This installs the Java JRE (Java Runtime Environment) which will allow you to run applications written in Java.

To install the JDK run the command:

sudo apt-get install openjdk-7-jdk

This allows you to compile Java applications to bytecode.

If you want the Oracle Java VM, which is a lot faster (optimized for embedded arm CPUs) and is also a developer preview (applications maybe buggy or crash) until some time into the future. Instead of the above instructions you need to download the file called Oracle JDK 8 (with JavaFX) for ARM Early Access on the Oracle Java 8 download page.

Remember to download the Oracle Java system on your Pi, or you won't be able to install it.

To install the Oracle Java System:

sudo tar zxvf jdk-8-ea-b36e-linux-arm-hflt-*.tar.gz -C /opt
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/jdk1.8.0/bin/java" 1 
sudo update-alternatives for other commands if needed (e.g. javac).
java -version

Then it is all installed.

Another thing, if you have more then one Java runtime installed you have to check which version you use with the commando java -version. If the output is:

java version 1.5.0 gij (GNU libgij)

Then you are using a other java runtime. You can resolve the issue by running

sudo update-alternatives --config java

and choosing the OpenJDK or Oracle option.

3 /opt is the way to go for Oracle JVMs. Recommended by Ubuntu. More accurate description of Oracle VM.
source | link
2 added bit if install doesn't work
source | link
1
source | link