Ubuntu Install Eclipse

Source: Internet
Author: User

first, the Eclipse installation process

First, ensure that the Java Virtual machine is installed before you install eclipse.

1. Download the zip package from Eclipse official website

: http://www.eclipse.org/downloads/?osType=linux&release=undefined

2. Unzip to/opt/(/OPT is usually installed in large commercial software or third party packages, I am accustomed to install third-party software here, of course, you can also install under/usr/local or other places)

sudo tar xzvf eclipse-standard-kepler-r-linux-gtk.tar.gz-c/opt

The- C parameter of tar specifies the directory where the files are extracted

Attention:

(1) Because/OPT permissions by default are owned by the root, ordinary users can not write, it is necessary to add sudo

If you want a normal user to be able to read and write to/opt, you can modify the permissions for that directory (for convenience only, of course, if you need to consider security issues, you should not modify this directory permission):

sudo chown-r jmwang:jmwang/opt

(2) If you want to change the eclipse directory to root, you can execute the following command

sudo chown-r root:root/opt/eclipse

3. Create a startup script in the/usr/bin directory eclipse

sudo gedit/usr/bin/eclipse

Then add the following to the file:

#!/bin/sh Export Eclipse_home=/opt/eclipse$eclipse_home/eclipse $*

ps:$* ([email protected]) The value of all parameters passed to the script

The purpose of this command is to be able to open eclipse by entering the Eclipse command directly under Terminal, but at this point there is not enough permission, and a 4th step is required.

4. Modify the permissions of the script to make it executable and execute the following command:

sudo chmod +x/usr/bin/eclipse

You can start the IDE by entering Eclipse from the command line.

5. Create a startup icon on the desktop

Method One, create from the desktop launcher

Command: Gnome-desktop-item-edit ~/--create-new

Name: Eclipse Command: Eclipse icon:/opt/eclipse/icon.xpm

Drag the startup icon you just created under the user directory (my/home/hadoop) to the desktop.

Attention:

(1) The above order is not an Ubuntu comes with, we need to install:

sudo apt-get install--no-install-recommends Gnome-panel

(2) The startup icon generated by this mode double-click the runtime will not produce a command prompt window, very friendly

Method Two, by creating in the application, is actually added to the applications

sudo gedit/usr/share/applications/eclipse.desktop

Then type in the file that pops up:

[Desktop Entry] Name=eclipsecomment=eclipse IDE (v4.3) exec=eclipseicon=/opt/eclipse/icon.xpmTerminal=falseType =applicationcategories=development; Startupnotify=true

Save the file. Then copy the file to your desktop, and you can double-click the desktop Eclipse icon to run Eclipse.

Note: The Red section indicates whether the double-click Runtime generates a command-line window, and True indicates that the command-line window is not friendly, so be sure to write the value of terminal as false

But there was a problem with my eclipse startup:

Unable to find the JRE path, the solution is as follows:

Scenario One, modify the Eclipse.ini file in the Eclipse installation directory, add the settings for the virtual machine parameter-VM on the first line

-vm

/opt/java/jdk1.7.0_25/jre/bin/java

#-VM parameter to specify which JVM to use to execute Eclipse

Scenario two, modify the startup script in step 3, specify the startup parameters here, as follows:

#!/bin/shexport eclipse_home=/opt/eclipse# $ECLIPSE _home/eclipse $* $ECLIPSE _home/eclipse-vm/opt/java/jdk1.7.0_25/ Jre/bin/java-data/home/jmwang/workspace &

#-VM parameter to specify which JVM to use to execute eclipse

#-date parameter to specify Eclipse's workspace

second, the eclipse uses the question to remember

1. Eclipse does not start the IDE after accidentally deleting the default workspace

Often encounter the deletion of the original workspace and the corresponding directory will find that eclipse can not start the problem, such as my original Linux user name jmwang,eclipse default workspace is/home/jmwang/workspace, but once because the need to change the user name, Instead of Hadoop, the corresponding/home/jmwang/workspace is also changed to/home/hadoop/workspace, and the following error has occurred when opening eclipse:

Of course, the first thought of changing the eclipse default workspace, to/home/hadoop/workspace, and only through the configuration file (the IDE can not open), the method is as follows:

Open the installation directory for Eclipse, open the following directory, and then click Configuration\.settings

There is a file org.eclipse.ui.ide.prefs under the folder, the content format is as follows:

max_recent_workspaces=5recent_workspaces=/home/hadoop/workspacerecent_workspaces_protocol= 3show_workspace_selection_dialog=falseeclipse.preferences.version=1

Modify the above red bold section, and finally save, found or not start eclipse, still reported that the error, the work space has not changed, think, recall the installation process of eclipse, found that I was in/usr/ An Eclipse startup script eclipse is built under the bin, with the following content:

#!/bin/shexport eclipse_home=/opt/eclipse# $ECLIPSE _home/eclipse $* $ECLIPSE _home/eclipse-vm/opt/java/jdk1.7.0_25/ Jre/bin/java-data/home/jmwang/workspace &

The red part is still the original space, and this priority is the highest, so the previous modification is invalid, change it to/home/hadoop/workspace and then open Eclipse.

2. How to restore the Eclipse Workspace tips feature

Since I've been accustomed to using only one workspace in eclipse, I've hooked up to the first time that eclipse has just been installed, when I hook up with a dialog box in the popup workspace selection that I won't be prompted with later.

The result of this sudden need to use its work space hint function, but suddenly do not know how to retrieve its cue function.

The Setup method is as follows:

Shuodown, Workspaces, Startup and Preferences, General, Windows------Workspace on startup

Ubuntu Install Eclipse

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.