Ubuntu builds Java development environment to install Java online
sudo add-apt-repository ppa:webupd8team/javasudo apt-get updatesudo apt-get install oracle-java8-installersudo apt-get install oracle-java8-set-default
Run again later
java -version
If you have an output similar to the following, you're done! If not, continue to Google or Baidu Bar.
"1.8.0_25"1.8.06425.25-b02, mixed mode)
Installing Java Offline
First you have to download the installation package here.
Suppose you download the jdk-8u25-linux-x64.tar.gz now and extract the folder jdk1.8.0_25.
Execute the following command to move Java to the Lib directory.
sudo mkdir -p /usr/lib/jvm/jdk1.8.0_25/sudo mv jdk1.8.0_25/* /usr/lib/jvm/jdk1.8.0_25/
Next, use the update-alternatives command to configure Java.
sudo"/usr/bin/java""java""/usr/lib/jvm/jdk1.8.0_25/bin/java"1sudo"/usr/bin/javac""javac""/usr/lib/jvm/jdk1.8.0_25/bin/javac"1sudo"/usr/bin/javaws""javaws""/usr/lib/jvm/jdk1.8.0_25/bin/javaws"1
The execution results are as follows.
update-alternatives: using /usr/lib/jvm/jdk1.8.0in 自动模式update-alternatives: using /usr/lib/jvm/jdk1.8.0in 自动模式update-alternatives: using /usr/lib/jvm/jdk1.8.0in 自动模式
Finally, perform the java-version and check the installation.
"1.8.0_25"1.8.06425.25-b02, mixed mode)
Install Eclipse
Note that eclipse wants to download JEE, not standard, remember.
First download eclipse.
Then unzip to /opt/eclipse
. Eclipse is now open, but the icon cannot be opened after it has been locked to the launcher.
/usr/share/applications
Create a new file under the directory eclipse.desktop
. The contents are as follows.
[Desktop Entry]Type=ApplicationName=eclipseComment=Eclipse IDEExec=/opt/eclipse/eclipseIcon=/opt/eclipse/icon.xpmCategories=DevelopmentTerminal=false
This file is then given executable permissions.
sudo chmod +x eclipse.desktop
At this point, you can start eclipse directly in the launcher.
If you think my blog to help you, welcome to share ~ I'd better have a tea egg oh ~
Ubuntu Builds Java development environment