Difference between revisions of "Install Eclipse"

(Linux/Ubuntu)
(Linux/Ubuntu)
Line 5: Line 5:
 
=Linux/Ubuntu=
 
=Linux/Ubuntu=
  
1. Check if your system is 32- or 64-bit. You can accomplish this by opening a Terminal, and typing:
+
Check if your system is 32- or 64-bit. You can accomplish this by opening a Terminal, and typing:
[code]
 
uname -m
 
[/code]
 
 
<math>\verb!uname -m!</math>
 
<math>\verb!uname -m!</math>
 
If you get: <math>\verb!x86_64!</math>, then you have a 64-bit system, if the response ends in 32, you have 32-bit system.
 
If you get: <math>\verb!x86_64!</math>, then you have a 64-bit system, if the response ends in 32, you have 32-bit system.
  
2. Go to: [http://www.eclipse.org/downloads/ Ubuntu Downloads]. On the third line from the top, that says: Eclipse IDE for Java Developers, click the Linux 32 Bit or Linux 64 Bit link on the right, depending on the type of your system.
+
Go to: [http://www.eclipse.org/downloads/ Ubuntu Downloads]. On the#!/bin/sh
 +
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
 +
export ECLIPSE_HOME="/opt/eclipse"
  
3. Download the relevant distribution of Eclipse (i.e. the tar.gz source file, which is an archive that conta).
+
<math>ECLIPSE_HOME/eclipse </math>* third line from the top, that says: Eclipse IDE for Java Developers, click the Linux 32 Bit or Linux 64 Bit link on the right, depending on the type of your system.
  
4. The next step is to extract the tar.gz source file. Open Terminal and navigate to the location where the tar.gz file was saved. Then, run:
+
Download the relevant distribution of Eclipse (i.e. the tar.gz source file, which is an archive that conta).
 +
 
 +
The next step is to extract the tar.gz source file. Open Terminal and navigate to the location where the tar.gz file was saved. Then, run:
 
\verb!tar xzf --name of file--!
 
\verb!tar xzf --name of file--!
 
such as:
 
such as:
tar xzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
+
tar xzf eclipse-java-juno-linux-gtk.tar.gz
  
5. Next, move the created eclipse executable to the /opt/ system folder. After entering the following command into Terminal, you need to enter the root password.  
+
Next, move the created eclipse executable to the /opt/ system folder. After entering the following command into Terminal, you need to enter the root password.  
mv eclipse /opt/
+
sudo mv eclipse /opt/
  
6. Now navigate to the /opt/ folder if you are not there already. Change the permissions on the eclipse executable to  
+
Now navigate to the /opt/ folder if you are not there already. Change the permissions on the eclipse executable to  
 
sudo chown -R root:root eclipse & sudo chmod -R +r eclipse
 
sudo chown -R root:root eclipse & sudo chmod -R +r eclipse
  
 +
Create an executable in your path, and open the text editor Nano:
 +
sudo touch /usr/bin/eclipse & sudo chmod 755 /usr/bin/eclipse &sudo nano /usr/bin/eclipse
 +
 +
Now enter the following text into Nano:
 +
#!/bin/sh
 +
#export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
 +
export ECLIPSE_HOME="/opt/eclipse"
 +
 +
<math>ECLIPSE_HOME/eclipse </math>*
 +
 +
Save your work (CTRL+o) and close Nano(CTRL+x)
 +
 +
Now run Eclipse for the first time:
 +
/opt/eclipse/eclipse -clean &
  
Now run eclipse:
+
(every next time you rin Eclipse, just enter eclipse in Terminal).
  
If you get an error about Java not installed, make you have Java Virtual Machine installed. You can do this by either installing OpenJDK Java 7 Runtime from the Ubuntu Software Center, or running the following command in Terminal:
+
Note: If you get an error about Java not installed, make you have Java Virtual Machine installed. You can do this by either installing OpenJDK Java 7 Runtime from the Ubuntu Software Center, or running the following command in Terminal:
 
sudo apt-get install openjdk-7-jre
 
sudo apt-get install openjdk-7-jre

Revision as of 13:54, 23 September 2012

The following article explains how to install Eclipse on your computer. The guide is targeted to students of the Java Programming course available on Art of Problem Solving. The version that we will be using is: Eclipse IDE for Java Developers, version 4.2.

Since the installation is system-specific for Mac, Windows, and Ubuntu, read and follow the instructions for the system that you have installed.

Linux/Ubuntu

Check if your system is 32- or 64-bit. You can accomplish this by opening a Terminal, and typing: $\verb!uname -m!$ If you get: $\verb!x86_64!$, then you have a 64-bit system, if the response ends in 32, you have 32-bit system.

Go to: Ubuntu Downloads. On the#!/bin/sh

  1. export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"

export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse$* third line from the top, that says: Eclipse IDE for Java Developers, click the Linux 32 Bit or Linux 64 Bit link on the right, depending on the type of your system.

Download the relevant distribution of Eclipse (i.e. the tar.gz source file, which is an archive that conta).

The next step is to extract the tar.gz source file. Open Terminal and navigate to the location where the tar.gz file was saved. Then, run: \verb!tar xzf --name of file--! such as: tar xzf eclipse-java-juno-linux-gtk.tar.gz

Next, move the created eclipse executable to the /opt/ system folder. After entering the following command into Terminal, you need to enter the root password. sudo mv eclipse /opt/

Now navigate to the /opt/ folder if you are not there already. Change the permissions on the eclipse executable to sudo chown -R root:root eclipse & sudo chmod -R +r eclipse

Create an executable in your path, and open the text editor Nano: sudo touch /usr/bin/eclipse & sudo chmod 755 /usr/bin/eclipse &sudo nano /usr/bin/eclipse

Now enter the following text into Nano:

  1. !/bin/sh
  2. export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"

export ECLIPSE_HOME="/opt/eclipse"

$ECLIPSE_HOME/eclipse$*

Save your work (CTRL+o) and close Nano(CTRL+x)

Now run Eclipse for the first time: /opt/eclipse/eclipse -clean &

(every next time you rin Eclipse, just enter eclipse in Terminal).

Note: If you get an error about Java not installed, make you have Java Virtual Machine installed. You can do this by either installing OpenJDK Java 7 Runtime from the Ubuntu Software Center, or running the following command in Terminal: sudo apt-get install openjdk-7-jre