Install the java environment and eclipse In Debian

Source: Internet
Author: User
Install the java environment In Debian and the Debian information in eclipse-Linux release technology. The following is a detailed description. Download the latest jdk 1.5, http://java.sun.com from sun's official website. Note: Download and decompress the version.
# Su root
Switch to the Super User and enter the download directory.
# Chmod a + x jdk-1_5_0-linux-i586.bin
#./Jdk-1_5_0-linux-i586.bin

Agree to the agreement. A jdk-1.5.0 directory will be obtained.
# Mkdir/usr/lib/j2se
# Mv jdk-1.5.0/usr/lib/j2se/5.0
# Cd/usr/lib
# Ln-s/usr/lib/j2se/5.0 java

Edit the/etc/mailcap file and move the java web start Settings to the top of the file. Otherwise, the custom settings will be washed out during update-mime.

# ----- User Section Begins -----#
# ----- User Section Ends -----#

Changed:

# ----- User Section Begins -----#
# Java Web Start
Application/x-java-jnlp-file;/usr/lib/java/jre/bin/javaws % s
# ----- User Section Ends -----#

Okay, basically it has been installed. The following describes the system dependencies.

# Apt-get install java-common
At this time, detailed documents of debian java are available in/usr/share/doc/java-common:
Debian-java-faq
Debian-java-policy

# Cd/usr/share/doc/java-common/dummy-packages/
There are 5 files:
Java1-runtime-dummy.control
Java2-compiler-dummy.control
Java2-runtime-dummy.control
Java-compiler-dummy.control
Java-virtual-machine-dummy.control

First, make sure that equivs has been installed. (If you have not installed equivs, run apt-get install equivs first)
# Equivs-build java1-runtime-dummy.control
# Equivs-build java2-compiler-dummy.control
# Equivs-build java2-runtime-dummy.control
# Equivs-build java-compiler-dummy.control
# Equivs-build java-virtual-machine-dummy.control
Generate five. Deb package.
# Dpkg-I *. deb

# Cp/usr/lib/java/jre/plugin/desktop/sun_java.desktop/usr/share/control-center-2.0/capplets/
Edit/usr/share/control-center-2.0/capplets/sun_java.desktop
Modify the java path:

[Desktop Entry]
Name = Java
Comment = Java Control Panel
Exec =/usr/lib/java/bin/ControlPanel
Icon =/usr/lib/java/jre/plugin/desktop/sun_java.png
Terminal = 0
Type = Application
Categories = Application; Settings; X-Sun-Supported; X-Red-Hat-Base;

In this way, you can start the java console through the menu.

Finally, create a link for the command under jdk bin, install the plug-in for mozilla, and create a shell file with the following content:

#! /Bin/bash
JDK_HOME =/usr/lib/java

For I in $ JDK_HOME/bin/*; do
Altname = 'basename $ I'
Echo "Processing $ altname ..."
Echo ""

If [-x "$ I"-a-e "$ JDK_HOME/man/man1/$ {altname}. 1"]
Then
Update-alternatives -- verbose -- install/usr/bin/$ altname $ I 500
-- Slave/usr/share/man/man1/$ {altname}. 1 $ {altname}. 1 $ JDK_HOME/man/man1/$ {altname}. 1
Else
Update-alternatives -- verbose -- install/usr/bin/$ altname $ I 500
Fi
Done

Update-alternatives -- verbose -- install/usr/lib/mozilla/plugins/libjavaplugin. so libjavaplugin. so $ JDK_HOME/jre/plugin/i386/ns7/libjavaplugin_oji.so 500
# Update-alternatives -- install/usr/share/gnome/vfolders/Settings/sun-java.desktop/usr/lib/java/jre/plugin/desktop/sun_java.desktop 500

# Sh your_shell

Test:
# Java-version
Output:
Java version "1.5.0"
Java (TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot (TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
# Man java
You can check the usage of java.

Finally install eclipse

Apt-get install eclipse

An error is prompted during startup, and the version is incorrect. You can modify it as follows:

Gedit/etc/eclipse/java_home

Modify one of them to your JAVA_HOME path. Change one of them to/usr/lib/java.

/Usr/lib/jvm/java-gcj

/Usr/lib/kaffe/pthreads

/Usr/lib/jvm/java-1.5.0-sun

/Usr/lib/j2se/1.5

/Usr/lib/j2se/1.4

/Usr/lib/j2sdk1.5-ibm

/Usr/lib/j2sdk1.4-ibm

/Usr/lib/j2sdk1.5-sun

/Usr/lib/j2sdk1.4-sun

(In this step, you can open/usr/bin/eclipse to find the path. In addition, eclipse can be obtained by creating a desktop starter from the application, from the perspective of attributes .)

Run it again.
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.