It’s very simple under Ubuntu, you just need to use the source installation
In addition, you can use Linux Install the general bin package, download the official bin package, install and unzip it on the terminal, and then modify the environment variable to point to the jdk.
Choose different versions according to your needs and download the bin package(Recommended learning: Java video tutorial)
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Choose your own installation platform, download and unzip it, I chose jdk-8u101-linux-x64.tar.gz
sudo tar zxvf ./jdk-8u101-linux-x64.tar.gz -C /usr/java/jdk1.8.0_101
Java environment configuration
JAVA_HOME=/usr/java/jdk1.8.0_101 JRE_HOME=$JAVA_HOME/jre JAVA_BIN=$JAVA_HOME/bin CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/binexport JAVA_HOME JRE_HOME PATH CLASSPATH 退出后: source ~/.bashrc
JAVA_HOME, JRE_HOME combined with your own path
Test Hello World!
class hello { public static void main(String[] args) { System.out.print("Hello world!\n"); } }
For more Java-related technical articles, please visit the Java Development Tutorial column to learn!
The above is the detailed content of How to install java on ubuntu. For more information, please follow other related articles on the PHP Chinese website!

The article discusses using Maven and Gradle for Java project management, build automation, and dependency resolution, comparing their approaches and optimization strategies.

The article discusses creating and using custom Java libraries (JAR files) with proper versioning and dependency management, using tools like Maven and Gradle.

The article discusses implementing multi-level caching in Java using Caffeine and Guava Cache to enhance application performance. It covers setup, integration, and performance benefits, along with configuration and eviction policy management best pra

The article discusses using JPA for object-relational mapping with advanced features like caching and lazy loading. It covers setup, entity mapping, and best practices for optimizing performance while highlighting potential pitfalls.[159 characters]

Java's classloading involves loading, linking, and initializing classes using a hierarchical system with Bootstrap, Extension, and Application classloaders. The parent delegation model ensures core classes are loaded first, affecting custom class loa


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft