| Contents | Index |
| On this page… |
|---|
Installing Sun Java Runtime Environment (JRE) Installing Eclipse IDE for C/C++ Developers |
To install the JRE, complete the following steps:
At your Windows or Linux command prompt, enter:
java -version
If Java is present, the command line responds with the version information, as this example shows.

If Java is missing or the version is lower than 1.6.x, download and install JRE 6.0 from http://www.java.com.
Get the path of the Java JRE by entering which java on the command line.
Set the PATH system variable in your operating system.
For example, in Windows 7:
Press the Windows key and search for "System environment variables" and open "Edit the system environment variables".
In System Properties, to go Advanced and click Environment Variables.
In the System variables, locate and select "Path".
Click the Edit button and add the path of the Java JRE to the Variable value.
For example , add C:\Program Files\Java\jre6\bin; to the Variable value.
Click OK to save your changes.
For example, with Linux:
Open a startup file, such as ~/ .cshrc.
Add the path of the Java JRE to the PATH variable.
For example, on a 64-bit Linux host computer, if you are using csh or tcsh, enter:
setenv PATH $PATH:/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/bin
For example, on a 64-bit Linux host computer, if you are using sh, ksh, or bash, enter:
PATH=$PATH:/local/MATLAB/R2011b/sys/java/jre/glnxa64/jre/bin ; export PATH
Save your changes and close the file.
For more information, see http://www.java.com/en/download/help/path.xml.
Verify that Java is working by entering java -version again or by visiting http://www.java.com/en/download/help/testvm.xml.
Note The following instructions are based on Eclipse 3.4 (Ganymede). More recent versions of the Eclipse IDE can have different appearances, menus, or software package names. |
The Eclipse IDE for C/C++ Developers package includes the Eclipse IDE and the C/C++ Development Tools (CDT). To install Eclipse IDE for C/C++ Developers package, complete the following steps:
Download the Ganymede SR2 zip file for Eclipse IDE for C/C++ Developers, from http://www.eclipse.org/downloads/packages/release/ganymede/sr2.
Extract the Eclipse files to a permanent location, such as C:\eclipse\ and create a desktop shortcut to eclipse.exe.
Start Eclipse, and select Help > Software Updates.
Look under the Installed Software tab, and verify that Eclipse has the following three CDT software packages.
Eclipse C/C++ Development Platform
Eclipse C/C++ Development Tools
Mylin Bridge: C/C++ Development
If you have a previous Eclipse installation that does not include CDT, complete the following steps:
In Eclipse, select Help > Software Updates.
Click the Available Software tab.
Click Ganymede Update Site.
Select C and C++ Development, and click Install.
When the installation process completes, click the Installed Software tab, and verify that you have CDT.
Most Linux distributions include the following GNU C/C++ development tools. Eclipse and CDT require these tools to compile code, build projects, and debug applications:
Assembler (as)
Archiver (ar)
compiler and linker (gcc)
debugger (gdb)
build utility (make)
Verify that the GNU tools are present and set the tool chain path:
On the Linux command line, enter:
gcc --version
gdb --version
as --version
ar --version
make --version
Compare the version of each tool with the following list of tested versions:
gcc 4.4
as 2.18
ar 2.18
gdb 6.8.x
make 3.81
If you are using Eclipse for targeting embedded Linux, disregard the version numbers in the preceding list.
To install a missing tool or to change the version of the tool, use the software installation manager that comes with your Linux distribution.
Alternatively, visit http://directory.fsf.org/GNU/ for more information about individual tools. Source files for the tools are available from:
binutils (includes as and ar), http://ftp.gnu.org/gnu/binutils/
Modify the PATH environment using the right commands for your running shell. You can also modify the path environment variable in your login scripts.
If you are using a Bash shell prompt, enter:
PATH=my_tool_path:$PATH
Where my_tool_path is the path to the GNU tool binaries. For example:
PATH=/bin:$PATH
If you are using a C shell prompt, enter:
setenv PATH my_tool_path:$PATH
Where my_tool_path is the path to the GNU tool binaries. For example:
setenv PATH /bin:$PATH
Windows typically does not include GNU C/C++ development tools. Eclipse and CDT require these tools to compile code, build projects, and debug applications.
Provide a GNU tool chain for Windows by installing MinGW:
Download and run the latest version of the "Automated MinGW Installer".
Start the MinGW installation wizard to perform a default installation.
Perform a default installation until you reach Select Components. At that step, select MSYS Basic System.
Then, complete the default installation process. Wait for the installation wizard to download, and install additional files from the Internet.
Set the PATH environment variable:
In Windows, right-click My Computer or Computer, and choose Properties.
Then select Advanced or Advanced system settings, and click Environment Variables.
Under System variables, scroll down to the Path variable.
Select Path, and click Edit.
Configure the operating system to the GNU tools when there are multiple paths:
Add the paths of the MinGW and MSYS bin folders to the beginning of the Variable value.
Use semicolons to separate the paths. For example, C:\mingw\bin;C:\mingw\msys\1.0\bin;

To verify the GNU tools installation and path settings, enter the following commands on the Windows command line:
gcc --version
gdb --version
as --version
ar --version
make --version
Each command displays the tool name and version on the command line. If you receive a message that the command is not recognized, verify that you completed the preceding installation and path configuration instructions.
You can use versions of the GNU tools that are more recent than the tested versions at your own risk.
![]() | Tested Software Versions | Configuring Your MathWorks Software to Work with Eclipse | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |