Installing Oracle JDK and Eclipse on Debian

Source: Internet
Author: User
Tags gz file java se

Test system: Debian 3.16.7-ckt11-1 (2015-05-24) x86_64 Gnu/linux

I. Installation of Oracle JDK

1. Download the Oracle JDK (or it should be called Java SE),

Download page: _

Http://www.oracle.com/technetwork/cn/java/javase/downloads/index.html

Jdk-8-update-20-x64:_

Http://download.oracle.com/otn-pub/java/jdk/8u20-b26/jdk-8u20-linux-x64.tar.gz

Download the tar.gz, unzip it, rename it to JDK and put it under/OPT/JDK. Make sure you can find worked directories such as/opt/jdk/bin,/opt/jdk/jre/bin.

2. Setting Environment variables

Before in Ubuntu,/etc/profile this file last added

Export path= $PATH:/opt/jdk/bin:/opt/jdk/jre/bin
Export classpath=./

Then log off or restart it, but once I do this this time, you cannot execute java-version in bash to test the installation success. So I added the last two lines to the

~/.BASHRC (that is, the. bashrc file under your home directory)

You can do it after you sign out.

3, Test!

Create a new empty file for Helloworld.java, enter

 Public class helloworld{    publicstaticvoid  main (String args[])    {        System.out.println ("Hello, world!" );    }}

After saving, open the terminal in the file directory and execute

Javac Helloworld.java

Java HelloWorld

If you output "Hello, world!", then the JDK installation is successful.

4, note that if Debian is 64-bit, then you should use the x64 JDK.

Ii. installation of Eclipse

1. Download page:

https://eclipse.org/downloads/

Image of China University of Science and Technology:

http://mirrors.ustc.edu.cn/eclipse/technology/epp/downloads/release/

Language Pack Download:

Http://mirrors.ustc.edu.cn/eclipse/technology/babel/babel_language_packs

2, downloaded to the tar.gz file, after decompression, put into the/opt/eclipse directory, maintain the path of the Eclipse executable is/opt/eclipse/eclipse

3. Double-click Eclipse, and if it runs successfully, skip to step 5th. If you don't see a hint for Java, take step 4th.

4, modify the Eclipse.ini, add at the beginning of the file

-vm
/opt/jdk/jre/bin/java

You can not do it.

5. Create a new Eclipse.desktop file in the/usr/share/applications directory, write

[Desktop Entry] Name=eclipsecomment=Eclipse ideexec=/opt/eclipse/eclipseicon=/opt/ Eclipse/icon.xpmterminal=Falsetype=applicationcategories=development; Startupnotify=true

and save. This allows you to see eclipse under the "Programming" section of the menu.

Installing Oracle JDK and Eclipse on Debian

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.