Java: Install Java

By Xah Lee. Date: . Last updated: .

Download the Java JDK here: http://www.oracle.com/technetwork/java/javase/downloads/index.html

(JDK means Java Developer's Kit)

Installing Java on Ubuntu

If you are on Unbuntu Linux, for example download jdk-8u25-linux-x64.tar.gz.

  1. Create a directory to put the java stuff there. For example, mkdir ~/apps
  2. Move the download tar file into the new directory. For example, mv ~/Downloads/jdk-8u25-linux-x64.tar.gz ~/apps
  3. Then cd to the directory. cd ~/apps
  4. Unpack it by: tar xvfz jdk-8u25-linux-x64.tar.gz

After unpacking, the most important directory is the bin dir. For example, on my machine i have:

Add Java's “bin” dir to your PATH environment variable. For example, put this in your ~/.bashrc:

# append java path to PATH
PATH=$HOME/apps/jdk1.8.0_25/bin:$PATH

Then, type . ~/.bashrc to reload the bash profile.

To test java, type java -version:

◆ java -version
java version "1.8.0_25"
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

See also: Clojure: Install

Java

  1. Install
  2. javac java jar javadoc

Java Basics

  1. Print String
  2. Strings
  3. Power Function
  4. Java Types and Type Conversion
  5. Function
  6. Arrays

Class, Inheritance

  1. extends
  2. Constructor
  3. Constructor Return Type
  4. Extending a Class that has Explicit Constructors
  5. static
  6. this
  7. super
  8. Access Specifiers

Abstract class, Interface

  1. abstract
  2. Interface

Package

  1. Package

Misc

  1. Collection, Map
  2. Read/Write File
  3. Convert File Encoding
  4. Complex Numbers in Java
  5. Unicode
  6. Number Literals