Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Install Java 8 on Ubuntu using PPA     - CentOS 6.5 opens the Xmanager Remote Desktop login (Linux)

- Redis Design and Implementation study notes (Database)

- Spring + MyBatis Multi data source switching (Database)

- Boot-Repair Tool - repair of frequent start-up problems (Linux)

- User rights management system under Linux (Linux)

- Ubuntu How to install Pacman (Linux)

- Kubernetes resolve application deployment model (Server)

- Use SecureCRT to transfer files between local and remote hosts (Linux)

- Oracle table space create large files (Database)

- Oracle Linux 7.1 install Oracle 12C RAC (Database)

- Ubuntu 14.04 Docker installation (Linux)

- Python developer of time-saving method (Programming)

- The basic method RHEL6 (CentOS6) used in the source package compiled RPM: Upgrade OpenSSH articles (Linux)

- CentOS boot image to achieve semi-automatic installation (Linux)

- Three details reflect the Unix system security (Linux)

- 14 useful example Linux Sort command (Linux)

- Oracle 11g modify MEMORY_TARGET (Database)

- Installation salt-minion on RHEL5 (Linux)

- Use Pylint regulate your Python code (Programming)

- How to configure security services under Linux (Linux)

  Install Java 8 on Ubuntu using PPA
  Add Date : 2018-11-21      
  Although I am not a Java engineer, I never and did not intend to write Java, but still very concerned about this technology. Java 8 on the new features:

The interface has been completely static method can be defined. A common example is the java class library, for some interfaces, such as Foo, there will be a static method of the tool class to generate or Foo object instance to use. Static methods can exist in the interface, so in most cases Foos tool class can use the interface in the public method to proxy (or Foos into package-private).

In addition, the more important thing is, Java 8 interface can define the default method. For example, a for-each loop method can be added to the java.lang.Iterable:

Public default void forEach (Consumer < ? Super T> action) {
    Objects.requireNonNull (action); for (T t: this) {
        Action.accept (t);

In the past, adding a method to a Java class library interface is basically impossible. Adding a method to an interface means breaking code that implements that interface, but now, as long as it provides a correct and sensible default method implementation, Java class library maintainers can add methods in the interface.

Java 8, a lot of the default method has been added to the core of the JDK interface.

The following is the focus of this article, the use of PPA in Ubuntu install Java 8 (support Ubuntu 10.04 - Ubuntu 14.04):

Sudo add-apt-repository ppa: webupd8team / java

Sudo apt-get update

Sudo apt-get install Oracle-java8-installer

When finished, you can view the version with the following command:

Javac -version

Installation of Java 8 requires a license, and if you want to install it automatically, you can run it before installing:

Echo oracle-java8-installer shared / accepted-oracle-license-v1-1 select true | sudo / usr / bin / debconf-set-selections

Setting the Java 8 environment variable:

Sudo apt-get install oracle-java8-set-default

Switch to Java 7:

Sudo update-java-alternatives -s java-7-oracle

And then switch to Java 8:

Sudo update-java-alternatives -s java-8-oracle
- Open Ubuntu system updates (Linux)
- Getting Started with Linux system to learn: how to install the Shrew Soft IPsec VPN on Linux (Linux)
- Build Python3.4 + PyQt5.5.1 + Eric6.1.1 development platform under Mac OS X 10.11.1 (Server)
- Ubuntu install image browser and manager Phototonic 1.6.17 (Linux)
- Ubuntu 14.04 build Hadoop 2.5.1 standalone and pseudo-distributed environment (32-bit) (Server)
- Ubuntu 15.04 installed JDK and configured as the default JDK (Linux)
- How to Install Winusb in Ubuntu 14.04 (Linux)
- How to Install Foreman under Ubuntu (Server)
- Features and prevention methods elaborate network security grayware (Linux)
- How VirtualBox and VMware virtual machine conversion (Linux)
- PostgreSQL Source Customization: Online global read only (Database)
- The basic principles of AIX system security (Linux)
- MongoDB query timeout exception SocketTimeoutException (Database)
- Linux based serial programming (Programming)
- Linux install Eclipse for C / C ++ Development (Linux)
- 12 Linux Process Management Commands (Linux)
- A step by step teach have to install multi-node cluster configuration Hadoop (Server)
- Necessity in Java packages (Programming)
- Linux `dirname $ 0` (Linux)
- C ++ runtime environment built on CentOS 6.6 and Oracle database connection (Database)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.