CommonIssues
From IcedTea
Contents |
Common Issues
Java heap space issues
If you run across an error like the following:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at org.eclipse.jdt.internal.compiler. etc...
This means that your copy of ecj is running on a Java VM which has not been allocated enough heap space to successfully compile the classes in IcedTea. Many Java VMs, including Sun's, set a maximum limit on the size of the heap. Java-based compilers like ecj and javac can exceed this (the same problem occurs when building GNU Classpath). Many distributions setup ecj to run with a script using something along the lines of:
java org.eclipse.jdt.internal.compiler.batch.Main
To this, you should add the option -Xmx512M after java like so:
java -Xmx512M org.eclipse.jdt.internal.compiler.batch.Main
This will increase the maximum size of the heap to 512MB which should be sufficient. Note that the IcedTea build does this, so this problem only usually occurs when building with ecj. Distributions that ship a version of ecj which uses gcj (either natively or via gij) will also not encounter this problem, as gcj has no such maximum heap size.
Lacking a valid JDK
If you get the message:
ERROR: Your BOOTDIR environment variable does not point to a valid JDK for bootstrapping this build. A JDK 7 build must be bootstrapped using JDK 1.6.0 fcs (or later). Apparently, your bootstrap JDK is version 1.4 Please update your ALT_BOOTDIR setting and start your build again.
Then the problem is likely to be with the java binary symlinked in bootstrap/jdk1.6.0/bin/java. By default, this will link to gij, which on many systems is not 1.5 compliant:
bootstrap/jdk1.6.0/bin/java -version java version "1.4.2" gij (GNU libgcj) version 4.1.2 (Gentoo 4.1.2 p1.0.2)
To use gcj as the JDK, you need a version which is 1.5 compliant. Only the unreleased version, 4.3, and RedHat's backport of this are. Some distributions may provide this version (e.g. Fedora, Gentoo via the GCJ overlay) while with others you will need to download and compile another copy of GCC to use this. See the Gentoo build instructions for how to do this. Alternatively, you can pass the --with-java option to configure in order to make the symlink point to a different VM which is compliant.
Generics-related build errors when building the langtools
If you come across errors like the following:
-def-pcompile: [javac] Compiling 2 source files [javac] ---------- [javac] 1. ERROR [javac] List<String> sortedKeys = new ArrayList<String>(); [javac] ^^^^ [javac] The type List is not generic; it cannot be parameterized with arguments <String>
this means that the Java compiler (bootstrap/jdk1.6.0/bin/javac) being used to compile the langtools is not using a 1.5 compliant classlibrary. Again, this tends to occur if your gcj is old (see above) as the libgcj being used will then not include a version of classes such as java.util.List that use generics. Either install a newer GCC or pass a different copy of GNU Classpath using the --with-libgcj-jar option.

