Difference between revisions of "Installing Eclipse"

From wiki.emacinc.com
Jump to: navigation, search
(removed extra code tag)
 
(20 intermediate revisions by 5 users not shown)
Line 1: Line 1:
Before beginning installation of Eclipse, it is important to ensure that you have the necessary tools. These tools can either be command line interface (CLI) or graphical programs. This guide provides instructions for both options.
+
{{todo|SEOKWREV <strike>Make sure this is good for OE 4 </strike>(11.13.13-10:57->KY+);(11.14.13-16:25->MD+);(02.27.13-17:50->MG+);(03.04.14-16:35->BS-);(03.10.14-11:30->MD+);(03.21.14-16:35->BS+)|Michael Gloff|project=oe 4,mg,ky,md,bs,SEOKWREV}}
  
{| class="wikitable conventions"
+
{{#seo:
 +
|title=Installing Eclipse
 +
|titlemode=append
 +
|keywords=Eclipse,Installing Eclipse,Install Java,Execute Eclipse,Add Eclipse to PATH
 +
|description=How to install Eclipse on to a Linux PC.
 +
}}
 +
==Introduction==
 +
 
 +
The instructions below detail the steps to install Eclipse on to a linux PC. Before beginning the installation of Eclipse, it is important to ensure that you have the necessary tools. These tools can either be command line interface (CLI) or graphical programs. This guide provides instructions for both options.
 +
 
 +
{| class="wikitable"
 
!colspan="2"|Table 1: Conventions
 
!colspan="2"|Table 1: Conventions
 
|-
 
|-
Line 9: Line 19:
 
that this directory be located somewhere within the development user's home directory.
 
that this directory be located somewhere within the development user's home directory.
 
|}
 
|}
 
{{mbox | type = notice | text = EMAC only provides an Eclipse distribution for installation on Linux PCs. It is not meant to be installed on the target board or Windows PCs.}}
 
<br>
 
  
 
== Required Tools ==
 
== Required Tools ==
 
* Web browser or other FTP-aware client
 
* Web browser or other FTP-aware client
* Archiving tool, two options are available
+
* Archiving tool.  Two options are available:
 
** Graphical: [http://utils.kde.org/projects/ark/ Ark] for KDE, [http://fileroller.sourceforge.net/ File Roller] for GNOME
 
** Graphical: [http://utils.kde.org/projects/ark/ Ark] for KDE, [http://fileroller.sourceforge.net/ File Roller] for GNOME
 
** CLI: [http://www.gnu.org/software/tar/ Tar] is standard
 
** CLI: [http://www.gnu.org/software/tar/ Tar] is standard
Line 22: Line 29:
  
 
=== Install Java ===
 
=== Install Java ===
Eclipse is a Java application and as such requires a Java Virtual Machine (JVM) to run. Several different JVM providers are available, including OpenJDK and Oracle Java. EMAC recommends installing OpenJDK version 6 to support the Eclipse 3.6 distribution. '''NEED TO TEST THIS -- CAN THEY USE VERSION 7?''' If you will not be doing any software development in the Java language, a Java Runtime Environment (JRE) is sufficient, otherwise, you will need to install a Java Development Kit (JDK).
+
Eclipse is a Java application and as such requires a Java Virtual Machine (JVM) to run. Several different JVM providers are available, including OpenJDK and Oracle Java. EMAC recommends installing OpenJDK version 6 or 7 to support the Eclipse 3.6 distribution. If you will not be doing any software development in the Java language, a Java Runtime Environment (JRE) is sufficient.  Otherwise, you will need to install a Java Development Kit (JDK). See the [http://openjdk.java.net/ OpenJDK ] or [http://www.oracle.com/technetwork/java/javase/downloads/index.html Oracle ] website for installing either the JVM or JDK.
  
Installation instructions will vary widely depending on the Linux distribution used on the development system. Most distributions, including Ubuntu and Debian, have standard packages available for OpenJDK on the distribution's software repositories. For example, to install OpenJDK6 JRE on Ubuntu or Debian, use the <code>openjdk-6-jre</code> package. For a JDK, the <code>openjdk-6-jdk</code> package can be installed instead of the JRE.  
+
Installation instructions will vary widely depending on the Linux distribution used on the development system. Most distributions, including Ubuntu and Debian, have standard packages available for OpenJDK on the distribution's software repositories. For example, to install OpenJDK6 JRE on Ubuntu or Debian run:
 +
<syntaxhighlight lang=bash>
 +
developer@ldc:~$ sudo apt-get install openjdk-6-jre:i386
 +
</syntaxhighlight>
 +
For the JDK, install the <code>openjdk-6-jdk:i386</code> package instead of the JRE.  
  
 
Refer to the documentation for your distribution for more information on how to install Java for your platform.
 
Refer to the documentation for your distribution for more information on how to install Java for your platform.
Line 33: Line 44:
 
</syntaxhighlight>
 
</syntaxhighlight>
  
=== Install EMAC Eclipse ===
+
=== Install Eclipse ===
# Download the EMAC Eclipse 3.6 distribution from the [ftp://ftp.emacinc.com/Controllers/Development_Kits/EMAC_Open_Tools/Linux/ EMAC ftp site].
+
# Download the Eclipse 3.6 distribution from the [ftp://ftp.emacinc.com/Controllers/Development_Kits/EMAC_Open_Tools/Linux/ EMAC ftp site].
# Uncompress: <br> '''Using a graphical archiving tool:''' Uncompress the archive to the chosen development directory. EMAC strongly recommends that <code>/install/directory/</code> is located somewhere within the developer's home directory. For assistance with extracting the archive, please see the documentation for your archiving tool. <br> '''Using <code>tar</code> from the CLI:''' All recent versions of tar have support for performing decompression as part of the unarchiving process, allowing this to be done with one command, as shown below: <syntaxhighlight lang=bash>
+
# Uncompress: <br> '''Using a graphical archiving tool:''' Uncompress the archive to the chosen development directory. EMAC strongly recommends that <code>/install/directory/</code> is located somewhere within the developer's home directory. For assistance with extracting the archive, please see the documentation for your archiving tool. <br>  
 +
'''Using <code>tar</code> from the CLI:''' The tar utility has the ability to both combine and extract archives. Here, the <code>x</code> flag is used to tell tar to extract files from the uncompressed stream sent to it from bzip2 (bzip2 is extracting the tarball and sending it to standard output).  The <code>f</code> flag points <code>tar</code> to the file to extract; since a <code>-</code> is passed to the <code>f</code> flag, the file is interpreted to be the standard input file stream instead of an actual file.  The <code>v</code> flag indicates that <code>tar</code> should produce verbose output (which is why it will display the files it's processing).
 +
<br />
 +
<syntaxhighlight lang=bash>
 
developer@ldc:~$ cd /install/directory
 
developer@ldc:~$ cd /install/directory
developer@ldc:~$ tar xjvf /download/directory/eclipse-3.6-Linux_EMAC-rc0.tar.bz2
+
developer@ldc:~$ bzip2 -cd /download/directory/eclipse-3.6-Linux_EMAC-rc0.tar.bz2 | tar xvf -
developer@ldc:~$ ls
+
</syntaxhighlight>
</syntaxhighlight> <syntaxhighlight lang=console>
+
<br />
 +
The list of extracted files will be output to the screen. This may take a minute to complete.
 +
<syntaxhighlight lang=console>
 
...
 
...
 
eclipse/
 
eclipse/
Line 46: Line 62:
  
 
=== Execute Eclipse ===
 
=== Execute Eclipse ===
If you are using the '''non-Qt version''' of the SDK, simply run the <code>eclipse</code> executable in the extracted directory to start Eclipse as shown below:
+
 
 +
Eclipse requires that the 32-bit JVM be specified in order to run. Configure the default global JVM by running:
 +
<syntaxhighlight lang=bash>
 +
developer@ldc:~$ sudo update-alternatives --config java
 +
</syntaxhighlight>
 +
Select the i386 option. If the option is not available, ensure that a 32-bit JRE is installed.
 +
 
 +
Alternatively, specify to Eclipse which JVM to use by adding the following line to <code>eclipse/eclipse.ini</code>
 +
-vm /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java
 +
Ensure that the path is correct for the JVM provider and JVM version in use. Viewing the Eclipse log, <code>${HOME}/workspace/.metadata/.log</code>, can be useful for troubleshooting any problems that may arise with Eclipse.  Note that there are periods before both <code>metadata</code> and <code>log</code> in that path.
 +
 
 +
If the "non-Qt version" of the SDK is installed, simply run the <code>eclipse</code> executable in the extracted directory to start Eclipse as shown below:
 +
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
 
developer@ldc:~$ /install/directory/eclipse/eclipse
 
developer@ldc:~$ /install/directory/eclipse/eclipse
 
</syntaxhighlight>
 
</syntaxhighlight>
  
If you are using the '''Qt version''' of the SDK and want to use Eclipse for Qt development, you will need to run Eclipse using the <code>emac-eclipse</code> script included in the SDK. For example, if the SDK for your system is located at <code>/install/directory/EMAC-OE-arm-linux-gnueabi-SDK_4.0</code>, Eclipse could be started with the following command:
+
If the "Qt version" of the SDK is installed, Eclipse will need to be run using the <code>emac-eclipse</code> script included in the SDK. For example, if the SDK for the system is located at <code>/install/directory/EMAC-OE-arm-linux-gnueabi-SDK_4.0</code>, Eclipse could be started with the following command:
 +
<syntaxhighlight lang=bash>
 +
developer@ldc:~$ /install/directory/EMAC-OE-arm-linux-gnueabi-SDK_4.0/emac_eclipse
 +
</syntaxhighlight>
 +
 
 +
==Add Eclipse to PATH==
 +
 
 +
Writing <code>/path/to/eclipse/eclipse</code> each time to start Eclipse can become tedious. For the Qt version of the SDK, an icon will be created on your desktop which will allow the user to launch Eclipse through the <code>emac_eclipse</code> script with a click.
 +
 
 +
For either version of the SDK, Eclipse can be launched from the shell.  The process is a little bit different for the Qt version than it is for the non-Qt version.
 +
 
 +
For the "non-Qt version":
 +
 
 +
Adding the path to the Eclipse executable to the user's <code>PATH</code> environment variable ensures that Eclipse can be started from within any directory on the system without having to explicitly specify the path to the executable.
 +
 
 +
<syntaxhighlight lang=bash>
 +
developer@ldc:~$ echo 'export PATH=$PATH:/home/developer/eclipse' >> ~/.bashrc
 +
</syntaxhighlight>
 +
 
 +
For the "Qt version":
 +
 
 +
The <code>emac_eclipse</code> script will need to be run to launch Eclipse and feed it the configuration it needs to work with the Qt version of the EMAC SDK.  The information for the non-Qt version, above, can additionally be used to make the Eclipse executable itself runnable from anywhere on the shell, but keep in mind that running it that way will not configure it to work with the EMAC Qt SDK.
 +
 
 
<syntaxhighlight lang=bash>
 
<syntaxhighlight lang=bash>
developer@ldc:~$ /install/directory/EMAC-OE-arm-linux-gnueabi-SDK_4.0
+
developer@ldc:~$ echo 'export PATH=$PATH:/home/developer/EMAC-OE-arm-linux-gnueabi-SDK_4.0' >> ~/.bashrc
 
</syntaxhighlight>
 
</syntaxhighlight>
  
{{mbox | type = notice | text = See the [[Configuring EMAC Eclipse]] page for more information about configuring the Eclipse installation, including instructions for creating and Eclipse desktop icon.}}
 
`
 
 
== Next Steps ==
 
== Next Steps ==
After completing the installation, continue by [[Configuring EMAC Eclipse]].
+
After completing the installation, continue by [[First_Time_Starting_Eclipse | starting Eclipse for the first time]].
  
[[Category:EMAC Eclipse]]
+
<!--[[Category:Eclipse]]-->

Latest revision as of 15:46, 21 March 2014

TODO: {{#todo:SEOKWREV Make sure this is good for OE 4 (11.13.13-10:57->KY+);(11.14.13-16:25->MD+);(02.27.13-17:50->MG+);(03.04.14-16:35->BS-);(03.10.14-11:30->MD+);(03.21.14-16:35->BS+)|Michael Gloff|oe 4,mg,ky,md,bs,SEOKWREV}}

Introduction

The instructions below detail the steps to install Eclipse on to a linux PC. Before beginning the installation of Eclipse, it is important to ensure that you have the necessary tools. These tools can either be command line interface (CLI) or graphical programs. This guide provides instructions for both options.

Table 1: Conventions
/download/directory/ Placeholder indicating the directory to which the SDK archive will be downloaded.
/install/directory/ Placeholder indicating the directory to which Eclipse will be extracted. EMAC recommends

that this directory be located somewhere within the development user's home directory.

Required Tools

  • Web browser or other FTP-aware client
  • Archiving tool. Two options are available:

Procedure

Install Java

Eclipse is a Java application and as such requires a Java Virtual Machine (JVM) to run. Several different JVM providers are available, including OpenJDK and Oracle Java. EMAC recommends installing OpenJDK version 6 or 7 to support the Eclipse 3.6 distribution. If you will not be doing any software development in the Java language, a Java Runtime Environment (JRE) is sufficient. Otherwise, you will need to install a Java Development Kit (JDK). See the OpenJDK or Oracle website for installing either the JVM or JDK.

Installation instructions will vary widely depending on the Linux distribution used on the development system. Most distributions, including Ubuntu and Debian, have standard packages available for OpenJDK on the distribution's software repositories. For example, to install OpenJDK6 JRE on Ubuntu or Debian run:

developer@ldc:~$ sudo apt-get install openjdk-6-jre:i386

For the JDK, install the openjdk-6-jdk:i386 package instead of the JRE.

Refer to the documentation for your distribution for more information on how to install Java for your platform.

Once Java has been installed, test the installation by verifying that the java command executes properly and reports the expected version:

developer@ldc:~$ java -version

Install Eclipse

  1. Download the Eclipse 3.6 distribution from the EMAC ftp site.
  2. Uncompress:
    Using a graphical archiving tool: Uncompress the archive to the chosen development directory. EMAC strongly recommends that /install/directory/ is located somewhere within the developer's home directory. For assistance with extracting the archive, please see the documentation for your archiving tool.

Using tar from the CLI: The tar utility has the ability to both combine and extract archives. Here, the x flag is used to tell tar to extract files from the uncompressed stream sent to it from bzip2 (bzip2 is extracting the tarball and sending it to standard output). The f flag points tar to the file to extract; since a - is passed to the f flag, the file is interpreted to be the standard input file stream instead of an actual file. The v flag indicates that tar should produce verbose output (which is why it will display the files it's processing).

developer@ldc:~$ cd /install/directory
developer@ldc:~$ bzip2 -cd /download/directory/eclipse-3.6-Linux_EMAC-rc0.tar.bz2 | tar xvf -


The list of extracted files will be output to the screen. This may take a minute to complete.

...
eclipse/
...

Execute Eclipse

Eclipse requires that the 32-bit JVM be specified in order to run. Configure the default global JVM by running:

developer@ldc:~$ sudo update-alternatives --config java

Select the i386 option. If the option is not available, ensure that a 32-bit JRE is installed.

Alternatively, specify to Eclipse which JVM to use by adding the following line to eclipse/eclipse.ini

-vm /usr/lib/jvm/java-6-openjdk-i386/jre/bin/java

Ensure that the path is correct for the JVM provider and JVM version in use. Viewing the Eclipse log, ${HOME}/workspace/.metadata/.log, can be useful for troubleshooting any problems that may arise with Eclipse. Note that there are periods before both metadata and log in that path.

If the "non-Qt version" of the SDK is installed, simply run the eclipse executable in the extracted directory to start Eclipse as shown below:

developer@ldc:~$ /install/directory/eclipse/eclipse

If the "Qt version" of the SDK is installed, Eclipse will need to be run using the emac-eclipse script included in the SDK. For example, if the SDK for the system is located at /install/directory/EMAC-OE-arm-linux-gnueabi-SDK_4.0, Eclipse could be started with the following command:

developer@ldc:~$ /install/directory/EMAC-OE-arm-linux-gnueabi-SDK_4.0/emac_eclipse

Add Eclipse to PATH

Writing /path/to/eclipse/eclipse each time to start Eclipse can become tedious. For the Qt version of the SDK, an icon will be created on your desktop which will allow the user to launch Eclipse through the emac_eclipse script with a click.

For either version of the SDK, Eclipse can be launched from the shell. The process is a little bit different for the Qt version than it is for the non-Qt version.

For the "non-Qt version":

Adding the path to the Eclipse executable to the user's PATH environment variable ensures that Eclipse can be started from within any directory on the system without having to explicitly specify the path to the executable.

developer@ldc:~$ echo 'export PATH=$PATH:/home/developer/eclipse' >> ~/.bashrc

For the "Qt version":

The emac_eclipse script will need to be run to launch Eclipse and feed it the configuration it needs to work with the Qt version of the EMAC SDK. The information for the non-Qt version, above, can additionally be used to make the Eclipse executable itself runnable from anywhere on the shell, but keep in mind that running it that way will not configure it to work with the EMAC Qt SDK.

developer@ldc:~$ echo 'export PATH=$PATH:/home/developer/EMAC-OE-arm-linux-gnueabi-SDK_4.0' >> ~/.bashrc

Next Steps

After completing the installation, continue by starting Eclipse for the first time.