blob: 0359bf040ff94e91a8bee86d8d3705c2c7f888db [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2014. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="../../book.css" charset="ISO-8859-1" type="text/css">
<title>Running on GCJ</title>
</head>
<body>
<h1>GCJ</h1>
<p>GCJ is an effort by the GCC team to provide an open source Java compiler and
runtime environment to interpret Java bytecode. Unfortunately, the GCJ runtime
environment is not an environment that is often tested on by Eclipse
developers.</p>
<p>The most common problems surrounding GCJ are:
-Eclipse does not start at all
-Eclipse throws a 'java.lang.ClassNotFoundException:
org.eclipse.core.runtime.Plugin' that can be found in the logs (located in
workspace/.metadata/.log)</p>
<p>The workspace's log file is a good place to check to identify whether GCJ is
being used or not. Every Eclipse log session should be prepended with
information about the runtime environment that was used to run Eclipse. The log
may include something like the following:</p>
<code>java.fullversion=GNU libgcj 4.2.1 (Debian 4.2.1-5)</code>
<p>If Eclipse does start, one can check which runtime environment is being used to
run Eclipse by going to 'Help &gt; About Eclipse SDK &gt; Configuration Details'. The
About Dialog itself can also provide other information, the build identifier
can be of particular interest as it is tagged by some distros. This allows the
user to identify whether Eclipse was downloaded through the distribution's
package management system or directly from the eclipse.org website.</p>
Eg: <code>Build id: M20070212-1330 (Ubuntu version: 3.2.2-0ubuntu3)</code>
<p>The two most common workarounds would be to:</p>
<ul>
<li>download the Eclipse binary from eclipse.org directly</li>
<li>run Eclipse using an alternate Java runtime environment</li></ul>
<p>To download Eclipse, try one of the links below:</p>
<ul>
<li><a href="http://www.eclipse.org/downloads/">http://www.eclipse.org/downloads/</a></li>
<li><a href="http://download.eclipse.org/eclipse/downloads/">http://download.eclipse.org/eclipse/downloads/</a></li></ul>
It is imperative that 64-bit builds are downloaded and used if a 64-bit Java
runtime environment has been installed. Below are two sample tarball names of
version 3.3.2 of the Eclipse SDK packaged for 32-bit and 64-bit processors.
<pre>eclipse-SDK-3.3.2-linux-gtk.tar.gz (32-bit)
eclipse-SDK-3.3.2-linux-gtk-x86_64.tar.gz (64-bit)</pre>
<p>To run Eclipse with an alternate Java runtime environment, the path to the Java
virtual machine's binary must be identified. With an Eclipse installation from
the distribution, altering the $PATH variable to include the path to the
alternate Java runtime environment is often not enough as the Eclipse that
Linux distributions package often performs a scan internally to pick up GCJ by
itself whilst ignoring what's on the $PATH. An example of the terminal's output
can be seen below:</p>
<code>searching for compatible vm...<br>
testing /usr/lib/jvm/java-7-icedtea...not found<br>
testing /usr/lib/jvm/java-gcj...found</code>
<p>Once the path to the virtual machine's binary has been identified, try running
Eclipse with the following command:</p>
<code>./eclipse -vm /path/to/jre/bin/java</code>
<p>For an actual example, it might look something like the following:</p>
<code>./eclipse -vm /usr/lib/jvm/sun-java-6/bin/java<br>
./eclipse -vm /opt/sun-jdk-1.6.0.02/bin/java</code>
<p>If this seems to solve the problem, it is likely that the problem really was
related to the use of GCJ as the Java runtime for running Eclipse. The
eclipse.ini file located within Eclipse's folder can be altered to
automatically pass this argument to Eclipse at startup. An example of its
content is presented below:</p>
<code>-showsplash<br>
org.eclipse.platform<br>
--launcher.XXMaxPermSize<br>
256m<br>
-vm<br>
/opt/sun-jdk-1.6.0.02/bin/java<br>
-vmargs<br>
-Xms40m<br>
-Xmx512m</code>
<p>Note that every argument must be on its own line. More information about the
eclipse.ini file can be found at <a href="http://wiki.eclipse.org/Eclipse.ini">http://wiki.eclipse.org/Eclipse.ini</a>.</p>
<p>If problems persists after downloading an installation of Eclipse from
eclipse.org and using a supported Java runtime environment (a list of which may be found in the readme_eclipse.html supplied with your installation), one should seek
assistance from the Eclipse team via its plethora of communication channels
like the <a href="http://www.eclipse.org/newsgroups/">newsgroups</a>, the IRC <a href="irc://irc.freenode.net/#eclipse">channel</a>, and/or <a href="https://bugs.eclipse.org/bugs/" target="_blank">bugzilla</a>.</p>
</body>
</html>