JDK 11 compiling class files fails with OOM exception - java

[Edit] This is no longer an issue. Did not change anything except using the current JDK11.
Updated jar dependencies for jdk 11 compliance.
Updated ant to 1.10.x.
Changed ANT_OPTS to use upto 5GB of memory.
Changed the javac task inside build script to use upto 5GB of memory and fork=true.
I get the following error:
[javac] Compiling 909 source files to C:\xyz\build\classes
[javac]
[javac]
[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError: Java heap space
[javac] at jdk.zipfs/jdk.nio.zipfs.ZipPath.relativize(ZipPath.java:226)
[javac] at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer$1.preVisitDirectory(JavacFileManager.java:525)
[javac] at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer$1.preVisitDirectory(JavacFileManager.java:521)
[javac] at java.base/java.nio.file.Files.walkFileTree(Files.java:2731)
[javac] at jdk.compiler/com.sun.tools.javac.file.JavacFileManager$ArchiveContainer.<init>(JavacFileManager.java:520)
[javac] at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.getContainer(JavacFileManager.java:316)
[javac] at jdk.compiler/com.sun.tools.javac.file.JavacFileManager.list(JavacFileManager.java:712)
[javac] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.list(ClassFinder.java:734)
[javac] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.scanUserPaths(ClassFinder.java:678)
[javac] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.fillIn(ClassFinder.java:551)
[javac] at jdk.compiler/com.sun.tools.javac.code.ClassFinder.complete(ClassFinder.java:299)
[javac] at jdk.compiler/com.sun.tools.javac.code.ClassFinder$$Lambda$42/0x00000008000d6040.complete(Unknown Source)
[javac] at jdk.compiler/com.sun.tools.javac.code.Symtab.lambda$addRootPackageFor$8(Symtab.java:780)
[javac] at jdk.compiler/com.sun.tools.javac.code.Symtab$$Lambda$44/0x00000008000d5840.complete(Unknown Source)
[javac] at jdk.compiler/com.sun.tools.javac.code.Symbol.complete(Symbol.java:642)
[javac] at jdk.compiler/com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:355)
[javac] at jdk.compiler/com.sun.tools.javac.tree.JCTree$JCCompilationUnit.accept(JCTree.java:529)
[javac] at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:286)
[javac] at jdk.compiler/com.sun.tools.javac.comp.Enter.classEnter(Enter.java:301)
[javac] at jdk.compiler/com.sun.tools.javac.comp.Enter.complete(Enter.java:576)
[javac] at jdk.compiler/com.sun.tools.javac.comp.Enter.main(Enter.java:560)
[javac] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:1066)
[javac] at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:937)
[javac] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:311)
[javac] at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:170)
[javac] at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:57)
[javac] at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:43)
Note : This same setup continues to build fine under java 8
Update 1:
Running ant with -verbose and the javac in the build file with verbose provides the search path that is used. Comparing thejdk8 and jdk11 entries :
JDK8 had the following entries that wern't present in jdk 11 search path
c:\jdk1.8.0_152\jre\lib\resources.jar
c:\jdk1.8.0_152\jre\lib\rt.jar
c:\jdk1.8.0_152\jre\lib\sunrsasign.jar
c:\jdk1.8.0_152\jre\lib\jsse.jar
c:\jdk1.8.0_152\jre\lib\jce.jar
c:\jdk1.8.0_152\jre\lib\charsets.jar
c:\jdk1.8.0_152\jre\lib\jfr.jar
c:\jdk1.8.0_152\jre\classes
c:\jdk1.8.0_152\jre\lib\ext\access-bridge-64.jar
c:\jdk1.8.0_152\jre\lib\ext\cldrdata.jar
c:\jdk1.8.0_152\jre\lib\ext\dnsns.jar
c:\jdk1.8.0_152\jre\lib\ext\jaccess.jar
c:\jdk1.8.0_152\jre\lib\ext\jfxrt.jar
c:\jdk1.8.0_152\jre\lib\ext\localedata.jar
c:\jdk1.8.0_152\jre\lib\ext\nashorn.jar
c:\jdk1.8.0_152\jre\lib\ext\sunec.jar
c:\jdk1.8.0_152\jre\lib\ext\sunjce_provider.jar
c:\jdk1.8.0_152\jre\lib\ext\sunmscapi.jar
c:\jdk1.8.0_152\jre\lib\ext\sunpkcs11.jar
c:\jdk1.8.0_152\jre\lib\ext\zipfs.jar
c:\jdk1.8.0_152\lib\tools.jar
C:\SourceRepo\xx\yy\
The last line is the root of the project where the build.xml exists.
After the search path, there are a bunch of "loading ZipFileIndexFileObject...".
Followed by class file generation of my classes.
Followed by putting them in a jar.
The entries in jdk11 that were missing in the jdk8 search path.
C:\jdk-11\lib\modules
The above modules doesn't exist.
And then it fails with OOM stacktrace as listed earlier.
Update 2 Oct 17'2018:
Got an openjdk11 docker image (linux), installed ant on it, mounted my source directory and did an ant build. Worked fine no issues. So it seems like a windows jdk11 issue to me right now.

Related

Compile failed when running a lucene example

After fixing the error like tools.jar and junit.jar not found (thanks to stack overflow) I tried to compile the example given in "lucene in action" book. But when I compiled I am getting this error. Can you tell what error I am getting and how to fix it?
Total time: 0 seconds
E:\LuceneInAction>ant Indexer
Buildfile: E:\LuceneInAction\build.xml
check-environment:
compile:
[javac] E:\LuceneInAction\build.xml:66: warning: 'includeantruntime' was not
set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 104 source files to E:\LuceneInAction\build\classes
[javac] E:\LuceneInAction\src\lia\analysis\AnalyzerUtils.java:3: warning: [d
eprecation] Assert in junit.framework has been deprecated
[javac] import junit.framework.Assert;
[javac] ^
[javac] E:\LuceneInAction\src\lia\handlingtypes\html\NekoHTMLHandler.java:18
: error: package org.apache.html.dom does not exist
[javac] import org.apache.html.dom.HTMLDocumentImpl;
[javac] ^
[javac] E:\LuceneInAction\src\lia\analysis\AnalyzerUtils.java:90: warning: [
deprecation] Assert in junit.framework has been deprecated
[javac] Assert.assertEquals(strings.length, tokens.length);
[javac] ^
[javac] E:\LuceneInAction\src\lia\analysis\AnalyzerUtils.java:93: warning: [
deprecation] Assert in junit.framework has been deprecated
[javac] Assert.assertEquals("index " + i, strings[i], tokens[i].termTe
xt());
[javac] ^
[javac] E:\LuceneInAction\src\lia\handlingtypes\html\NekoHTMLHandler.java:32
: error: cannot find symbol
[javac] new HTMLDocumentImpl().createDocumentFragment();
[javac] ^
[javac] symbol: class HTMLDocumentImpl
[javac] location: class NekoHTMLHandler
[javac] Note: Some input files use unchecked or unsafe operations.
[javac] Note: Recompile with -Xlint:unchecked for details.
[javac] 2 errors
[javac] 3 warnings
BUILD FAILED
E:\LuceneInAction\build.xml:66: Compile failed; see the compiler error output fo
r details.
Total time: 2 seconds
Sorry I dont have enough reputaion to post image
Tt is complaining about your jar which contains HtmlDocumentImpl not being on the classpath. Maybe xerces? A specific version.
The JUnits are a warning that it the Assert which comes from org.framework. You can update your JUnit jar file or leave it as is since that isnt the cause of the error.
The errors are due to a jar not being on your classpath. which in my guess is xerces

Error building Android app with Cordova 3.1 CLI

I am attempting to run "cordova build android" through phonegap CLI with Terminal on my Mac.
First I downloaded the Android SDK.
Then I set up the project and added android.
Then I attempted "cordova build android" and received the following error:
Error: An error occurred while building the android project. Please
install Android target 17 (the Android newest SDK). Make sure you have
the latest Android tools installed as well. Run "android" from your
command-line to install/update any missing SDKs or tools.
So I ran "android" and installed everything related to target 17.
Then I attempted "cordova build android" again and receive the following compile errors:
-compile:
[javac] Compiling 3 source files to /Users/johnmacadam/Desktop/com.test.hello/platforms/android/bin/classes
[javac] /Users/johnmacadam/Desktop/com.test.hello/platforms/android/src/com/ZZZ.java:20:
';' expected
[javac] package com.humorthatworks.501ways;
[javac] ^
[javac] /Users/johnmacadam/Desktop/com.test.hello/platforms/android/src/com/ZZZ.java:25:
expected
[javac] public class 501Ways extends CordovaActivity
[javac] ^
[javac] /Users/johnmacadam/Desktop/com.test.hello/platforms/android/src/com/ZZZ.java:25:
expected
[javac] public class ZZZ extends CordovaActivity
[javac] ^
[javac] /Users/johnmacadam/Desktop/com.test.hello/platforms/android/src/com/ZZZ.java:25:
expected
[javac] public class ZZZ extends CordovaActivity
[javac] ^
[javac] /Users/johnmacadam/Desktop/com.test.hello/platforms/android/gen/com/ZZZ/BuildConfig.java:2:
';' expected
[javac] package com.ZZZ;
[javac] ^
[javac] /Users/johnmacadam/Desktop/com.test.hello/platforms/android/gen/com/ZZZ/R.java:8:
';' expected
[javac] package com.ZZZ;
[javac] ^
[javac] 6 errors
BUILD FAILED
/Users/johnmacadam/Documents/adt-bundle/sdk/tools/ant/build.xml:720:
The following error occurred while executing this line:
/Users/johnmacadam/Documents/adt-bundle/sdk/tools/ant/build.xml:734:
Compile failed; see the compiler error output for details.
Any ideas/suggestions?
In your config.xml you can't have a widget id with number as a first character after a dot.
For example: com.42myapp.test or com.myapp.42test won't work as well as 42com.myapp.test.
It will trigger an error from the compiler.
The error will occur only for android platform, iOS handle it well.
Turns out my problem was starting the project with a number... Java couldn't handle a number as the first character and would throw an error when attempting to compile.
In my case, I'm using Ionic Framework, I forgot about Java convetions for package name and I made the mistake of using the identified _200 for my project when doing:
ionic start _200
Hapilly, starting a new project with a proper package identifier worked just fine:
ionic start blah

Ant build works on one system and not another

We recently added FindBugs to our build and test process, but we've run into problems building when we are using the #SuppressWarning annotation.
More interestingly, the code will compile on our three developer laptops, but not on our build system, even though the code is the same and the Java compiler in use is the same (1.5.0_22 - 32 bit).
Here is the problem: We have a project, HCSBeans, that depends on another project, CommonLibrary. CommonLibrary uses #SuppressWarning once, while HCSBeans does not. CommonLibrary builds on our laptops and the build system, but HCSBeans does not build on the build system. At this point I cannot find a difference between the build system and my laptop.
Here is the verbose Ant output from the build system (note: we are not using Maven):
-do-compile:
[mkdir] Created dir: C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\build\empty
[javac] com\hcs\orc\ui\BindingHandler.java added as com\hcs\orc\ui\BindingHandler.class doesn't exist.
[javac] com\hcs\orc\ui\JRadioButtonUpdatable.java added as com\hcs\orc\ui\JRadioButtonUpdatable.class doesn't exist.
[javac] com\hcs\orc\ui\JTextAreaSizeFix.java added as com\hcs\orc\ui\JTextAreaSizeFix.class doesn't exist.
[javac] com\hcs\orc\ui\ORCAssignmentPanel.java added as com\hcs\orc\ui\ORCAssignmentPanel.class doesn't exist.
[javac] com\hcs\orc\ui\ORCCheckBox.java added as com\hcs\orc\ui\ORCCheckBox.class doesn't exist.
[javac] com\hcs\orc\ui\ORCLabel.java added as com\hcs\orc\ui\ORCLabel.class doesn't exist.
[javac] com\hcs\orc\ui\ORCLabelBeanInfo.java added as com\hcs\orc\ui\ORCLabelBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCPanel.java added as com\hcs\orc\ui\ORCPanel.class doesn't exist.
[javac] com\hcs\orc\ui\ORCPanelBeanInfo.java added as com\hcs\orc\ui\ORCPanelBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButton.java added as com\hcs\orc\ui\ORCRadioButton.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButtonBeanInfo.java added as com\hcs\orc\ui\ORCRadioButtonBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButtonGroup.java added as com\hcs\orc\ui\ORCRadioButtonGroup.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButtonGroupBeanInfo.java added as com\hcs\orc\ui\ORCRadioButtonGroupBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCScrollPane.java added as com\hcs\orc\ui\ORCScrollPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCScrollPaneBeanInfo.java added as com\hcs\orc\ui\ORCScrollPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSeparator.java added as com\hcs\orc\ui\ORCSeparator.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSeparatorBeanInfo.java added as com\hcs\orc\ui\ORCSeparatorBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSplitPane.java added as com\hcs\orc\ui\ORCSplitPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSplitPaneBeanInfo.java added as com\hcs\orc\ui\ORCSplitPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTabbedPane.java added as com\hcs\orc\ui\ORCTabbedPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTabbedPaneBeanInfo.java added as com\hcs\orc\ui\ORCTabbedPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTable.java added as com\hcs\orc\ui\ORCTable.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTableBeanInfo.java added as com\hcs\orc\ui\ORCTableBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextArea.java added as com\hcs\orc\ui\ORCTextArea.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextAreaBeanInfo.java added as com\hcs\orc\ui\ORCTextAreaBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextField.java added as com\hcs\orc\ui\ORCTextField.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextFieldBeanInfo.java added as com\hcs\orc\ui\ORCTextFieldBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextPane.java added as com\hcs\orc\ui\ORCTextPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextPaneBeanInfo.java added as com\hcs\orc\ui\ORCTextPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\RoundButtonBorder.java added as com\hcs\orc\ui\RoundButtonBorder.class doesn't exist.
[javac] com\hcs\orc\ui\TextLabelUI.java added as com\hcs\orc\ui\TextLabelUI.class doesn't exist.
[javac] com\hcs\orc\ui\TextTransfer.java added as com\hcs\orc\ui\TextTransfer.class doesn't exist.
[javac] com\hcs\orc\ui\TouchButton.java added as com\hcs\orc\ui\TouchButton.class doesn't exist.
[javac] com\hcs\orc\ui\TouchButtonUpdatable.java added as com\hcs\orc\ui\TouchButtonUpdatable.class doesn't exist.
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box.gif skipped - don't know how to handle it
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box_disabled.gif skipped - don't know how to handle it
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box_x.gif skipped - don't know how to handle it
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box_x_disabled.gif skipped - don't know how to handle it
[javac] Compiling 34 source files to C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\build\classes
[javac] Using external javac compiler
[javac] Compilation arguments:
[javac] '-d'
[javac] 'C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\build\classes'
[javac] '-classpath'
[javac] 'C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\build\classes;C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\CommonLibrary\dist\CommonLibrary.jar;C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\lib\swing-layout-1.0.4.jar'
[javac] '-sourcepath'
[javac] 'C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\build\empty'
[javac] '-target'
[javac] '1.5'
[javac] '-encoding'
[javac] 'windows-1252'
[javac] '-g'
[javac] '-source'
[javac] '1.5'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] Files to be compiled:
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\BindingHandler.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\JRadioButtonUpdatable.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\JTextAreaSizeFix.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCAssignmentPanel.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCCheckBox.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCLabel.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCLabelBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCPanel.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCPanelBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButton.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButtonBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButtonGroup.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButtonGroupBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCScrollPane.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCScrollPaneBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSeparator.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSeparatorBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSplitPane.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSplitPaneBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTabbedPane.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTabbedPaneBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTable.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTableBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextArea.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextAreaBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextField.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextFieldBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextPane.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextPaneBeanInfo.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\RoundButtonBorder.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\TextLabelUI.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\TextTransfer.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\TouchButton.java
[javac] C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\src\com\hcs\orc\ui\TouchButtonUpdatable.java
[javac] An exception has occurred in the compiler (1.5.0_22). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
[javac] com.sun.tools.javac.code.Symbol$CompletionFailure: file edu\umd\cs\findbugs\annotations\SuppressWarnings.class not found
[ant] Exiting C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\HCSBeans\build.xml.
[antcall] Exiting C:\Documents and Settings\stephen\.hudson\jobs\ORC Trunk\workspace\orc\nb\build.xml.
Here is the verbose Ant output from my laptop:
-do-compile:
[mkdir] Created dir: C:\hcs\orc\nb\HCSBeans\build\empty
[javac] com\hcs\orc\ui\BindingHandler.java added as com\hcs\orc\ui\BindingHandler.class doesn't exist.
[javac] com\hcs\orc\ui\JRadioButtonUpdatable.java added as com\hcs\orc\ui\JRadioButtonUpdatable.class doesn't exist.
[javac] com\hcs\orc\ui\JTextAreaSizeFix.java added as com\hcs\orc\ui\JTextAreaSizeFix.class doesn't exist.
[javac] com\hcs\orc\ui\ORCAssignmentPanel.java added as com\hcs\orc\ui\ORCAssignmentPanel.class doesn't exist.
[javac] com\hcs\orc\ui\ORCCheckBox.java added as com\hcs\orc\ui\ORCCheckBox.class doesn't exist.
[javac] com\hcs\orc\ui\ORCLabel.java added as com\hcs\orc\ui\ORCLabel.class doesn't exist.
[javac] com\hcs\orc\ui\ORCLabelBeanInfo.java added as com\hcs\orc\ui\ORCLabelBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCPanel.java added as com\hcs\orc\ui\ORCPanel.class doesn't exist.
[javac] com\hcs\orc\ui\ORCPanelBeanInfo.java added as com\hcs\orc\ui\ORCPanelBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButton.java added as com\hcs\orc\ui\ORCRadioButton.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButtonBeanInfo.java added as com\hcs\orc\ui\ORCRadioButtonBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButtonGroup.java added as com\hcs\orc\ui\ORCRadioButtonGroup.class doesn't exist.
[javac] com\hcs\orc\ui\ORCRadioButtonGroupBeanInfo.java added as com\hcs\orc\ui\ORCRadioButtonGroupBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCScrollPane.java added as com\hcs\orc\ui\ORCScrollPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCScrollPaneBeanInfo.java added as com\hcs\orc\ui\ORCScrollPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSeparator.java added as com\hcs\orc\ui\ORCSeparator.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSeparatorBeanInfo.java added as com\hcs\orc\ui\ORCSeparatorBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSplitPane.java added as com\hcs\orc\ui\ORCSplitPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCSplitPaneBeanInfo.java added as com\hcs\orc\ui\ORCSplitPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTabbedPane.java added as com\hcs\orc\ui\ORCTabbedPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTabbedPaneBeanInfo.java added as com\hcs\orc\ui\ORCTabbedPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTable.java added as com\hcs\orc\ui\ORCTable.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTableBeanInfo.java added as com\hcs\orc\ui\ORCTableBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextArea.java added as com\hcs\orc\ui\ORCTextArea.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextAreaBeanInfo.java added as com\hcs\orc\ui\ORCTextAreaBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextField.java added as com\hcs\orc\ui\ORCTextField.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextFieldBeanInfo.java added as com\hcs\orc\ui\ORCTextFieldBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextPane.java added as com\hcs\orc\ui\ORCTextPane.class doesn't exist.
[javac] com\hcs\orc\ui\ORCTextPaneBeanInfo.java added as com\hcs\orc\ui\ORCTextPaneBeanInfo.class doesn't exist.
[javac] com\hcs\orc\ui\RoundButtonBorder.java added as com\hcs\orc\ui\RoundButtonBorder.class doesn't exist.
[javac] com\hcs\orc\ui\TextLabelUI.java added as com\hcs\orc\ui\TextLabelUI.class doesn't exist.
[javac] com\hcs\orc\ui\TextTransfer.java added as com\hcs\orc\ui\TextTransfer.class doesn't exist.
[javac] com\hcs\orc\ui\TouchButton.java added as com\hcs\orc\ui\TouchButton.class doesn't exist.
[javac] com\hcs\orc\ui\TouchButtonUpdatable.java added as com\hcs\orc\ui\TouchButtonUpdatable.class doesn't exist.
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box.gif skipped - don't know how to handle it
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box_disabled.gif skipped - don't know how to handle it
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box_x.gif skipped - don't know how to handle it
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\resources\black_box_x_disabled.gif skipped - don't know how to handle it
[javac] Compiling 34 source files to C:\hcs\orc\nb\HCSBeans\build\classes
[javac] Using external javac compiler
[javac] Compilation arguments:
[javac] '-d'
[javac] 'C:\hcs\orc\nb\HCSBeans\build\classes'
[javac] '-classpath'
[javac] 'C:\hcs\orc\nb\HCSBeans\build\classes;C:\hcs\orc\nb\CommonLibrary\dist\CommonLibrary.jar;C:\Program Files (x86)\NetBeans 7.2\platform\modules\ext\swing-layout-1.0.4.jar'
[javac] '-sourcepath'
[javac] 'C:\hcs\orc\nb\HCSBeans\build\empty'
[javac] '-target'
[javac] '1.5'
[javac] '-encoding'
[javac] 'windows-1252'
[javac] '-g'
[javac] '-source'
[javac] '1.5'
[javac]
[javac] The ' characters around the executable and arguments are
[javac] not part of the command.
[javac] Files to be compiled:
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\BindingHandler.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\JRadioButtonUpdatable.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\JTextAreaSizeFix.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCAssignmentPanel.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCCheckBox.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCLabel.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCLabelBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCPanel.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCPanelBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButton.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButtonBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButtonGroup.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCRadioButtonGroupBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCScrollPane.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCScrollPaneBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSeparator.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSeparatorBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSplitPane.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCSplitPaneBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTabbedPane.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTabbedPaneBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTable.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTableBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextArea.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextAreaBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextField.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextFieldBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextPane.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\ORCTextPaneBeanInfo.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\RoundButtonBorder.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\TextLabelUI.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\TextTransfer.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\TouchButton.java
[javac] C:\hcs\orc\nb\HCSBeans\src\com\hcs\orc\ui\TouchButtonUpdatable.java
Other than the compile error, I don't see any difference.
Other things worth noting:
Deleting and rechecking out the source code for both projects
from SVN.
Comparing the versions of Java. Both are 32-bit Java 1.5.0_22. I know that is old, but we have customers who insist upon it.
There is only one reference to #SuppressWarning in CommonLibrary and none in HCSBeans.
We use annotations.jar and jsr305.jar when building the CommonLibrary, but they are not packaged with it and not referenced by HCSBeans. They should not be necessary after the build.
Our laptops are 64-bit while the build system is 32-bit, but both Java installs are 32-bit.
All computers are MS Windows.
Update
I switched the build server to compile HCSBean with Java 1.6 and the code compiles (after removing an unused import to SwingUtilities2), but if I switch it back to Java 1.5 it still fails with the same error. I'm beginning to suspect a problem with the Java 1.5 compiler.
Update 2
Well a co-worker found the actual difference. Not sure why it is occurring, but here is the difference between the resulting builds. On our laptops, the CommonLibrary.jar MANIFEST.MF file contains this line:
Class-Path: lib/annotations.jar lib/jsr305.jar
This means that building the HCSBeans project, it finds the annotations.jar file it needs. However, this Class-Path line is not present when we build on the build server. Not sure why, but that is the next line of investigation.
So we found the problem. Our laptops, having NetBeans installed (even if we weren't building directly from NetBeans) were using the CopyLibs to build the jar file, which added the needed line to the Manifest.MF file:
Class-Path: lib/annotations.jar lib/jsr305.jar
However, our build server, not having NetBeans installed was using j2seproject1:jar to build the jar file.
The solution was to add this to the -D Javac properties when building on our build server (which is Hudson, for those interested):
libs.CopyLibs.classpath=C:\\Documents and Settings\\stephen\\.hudson\\jobs\\ORC Trunk\\workspace\\orc\\lib\\netbeans\\org-netbeans-modules-java-j2seproject-copylibstask.jar
Now both our laptops and the build server are using CopyLibs and they both compile.
Yikes! What a mess to figure out.
Thanks for those who gave me pointers along the way ( #Peter-Eliot & #Disco3 ).
looks like the library is using the FindBugs version of SuppressWarning, not the java.lang version. #SuppressWarning to #java.lang.SuppressWarning and/or remove the import of the FindBugs version of SuppressWarning and see if that fixes it?
Also try adding FindBugs as a library in the classpath hudson looks at. It looks like on your developer machines you are building in NetBeans, and I wouldn't be shocked if Netbeans snuck FindBugs into the classpath that ant uses

is this a javac bug or some error in my code

When I run my Ant script, I get the following error
compile-src:
[echo] Source include pattern = **/*.java
[echo] Source exclude pattern =
[echo] Compiling From Source: = /u1/cibuild/.hudson/jobs/LDICommon/workspace/src
[javac] Compiling 99 source files to /u1/cibuild/.hudson/jobs/LDICommon/workspace/dbg1.5/classes/src
[javac] An exception has occurred in the compiler (1.5.0_09). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you.
[javac] java.lang.AssertionError: {rawtypes}
[javac] at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitArray(TreeMaker.java:634)
[javac] at com.sun.tools.javac.code.Attribute$Array.accept(Attribute.java:124)
[javac] at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:637)
[javac] at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.visitCompoundInternal(TreeMaker.java:628)
[javac] at com.sun.tools.javac.tree.TreeMaker$AnnotationBuilder.translate(TreeMaker.java:641)
[javac] at com.sun.tools.javac.tree.TreeMaker.Annotation(TreeMaker.java:649)
[javac] at com.sun.tools.javac.tree.TreeMaker.Annotations(TreeMaker.java:570)
[javac] at com.sun.tools.javac.tree.TreeMaker.VarDef(TreeMaker.java:554)
[javac] at com.sun.tools.javac.comp.Lower.visitIterableForeachLoop(Lower.java:2892)
[javac] at com.sun.tools.javac.comp.Lower.visitForeachLoop(Lower.java:2755)
[javac] at com.sun.tools.javac.tree.Tree$ForeachLoop.accept(Tree.java:597)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
[javac] at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
[javac] at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
[javac] at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
[javac] at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
[javac] at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
[javac] at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.comp.Lower.visitForLoop(Lower.java:2948)
[javac] at com.sun.tools.javac.tree.Tree$ForLoop.accept(Tree.java:581)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.comp.Lower.visitIterableForeachLoop(Lower.java:2894)
[javac] at com.sun.tools.javac.comp.Lower.visitForeachLoop(Lower.java:2755)
[javac] at com.sun.tools.javac.tree.Tree$ForeachLoop.accept(Tree.java:597)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
[javac] at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
[javac] at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
[javac] at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.comp.Lower.visitIf(Lower.java:2382)
[javac] at com.sun.tools.javac.tree.Tree$If.accept(Tree.java:715)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
[javac] at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
[javac] at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
[javac] at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.comp.Lower.visitIf(Lower.java:2383)
[javac] at com.sun.tools.javac.tree.Tree$If.accept(Tree.java:715)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:54)
[javac] at com.sun.tools.javac.tree.TreeTranslator.visitBlock(TreeTranslator.java:145)
[javac] at com.sun.tools.javac.comp.Lower.visitBlock(Lower.java:2927)
[javac] at com.sun.tools.javac.tree.Tree$Block.accept(Tree.java:535)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.tree.TreeTranslator.visitMethodDef(TreeTranslator.java:129)
[javac] at com.sun.tools.javac.comp.Lower.visitMethodDefInternal(Lower.java:2267)
[javac] at com.sun.tools.javac.comp.Lower.visitMethodDef(Lower.java:2186)
[javac] at com.sun.tools.javac.tree.Tree$MethodDef.accept(Tree.java:478)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.comp.Lower.visitClassDef(Lower.java:1989)
[javac] at com.sun.tools.javac.tree.Tree$ClassDef.accept(Tree.java:434)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1881)
[javac] at com.sun.tools.javac.comp.Lower.translate(Lower.java:1901)
[javac] at com.sun.tools.javac.comp.Lower.translateTopLevelClass(Lower.java:3064)
[javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:487)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:592)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:544)
[javac] at com.sun.tools.javac.Main.compile(Main.java:67)
[javac] at com.sun.tools.javac.Main.main(Main.java:52)
BUILD FAILED
I'm not sure what is going on, I can compile this project outside ant (in eclipse) without an issue.
I'm almost sure that the message about a bug in the compiler is a red herring, I suspect the real problem has to do with the message:
[javac] java.lang.AssertionError: {rawtypes}
but there isn't much information to help tracking down the root cause of the error.
Any ideas?
Given your compiler is really old and not publicly supported, I would assume that upgrading your JDK would be a good starting place.
The last free version of Java 5.0 is update 22 (you have update 9).
http://www.oracle.com/technetwork/java/javase/downloads/index-jdk5-jsp-142662.html
The latest version of Java is Java 6 update 26.
http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html
It clearly says that it is a compiler bug:
An exception has occurred in the compiler (1.5.0_09). Please file a bug at the
Java Developer Connection (http://java.sun.com/webapps/bugreport) after
checking the Bug Parade for duplicates. Include your program and the following
diagnostic in your report. Thank you.
As Peter said, first check if the same problem occurs in a newer javac version, and then file a bug report. (You might try to minimize down your code to an SSCEE first.)
Eclipse does not use javac, but has its own compiler included, thus this does not tell us anything here.

javac: java.lang.OutOfMemoryError when running ant from Eclipse

I have given loads of memory to eclipse in the ini file but its still not using anything more than 300mb which i can see in the task manager.
[javac] The system is out of resources.
[javac] Consult the following stack trace for details.
[javac] java.lang.OutOfMemoryError: Java heap space
[javac] at com.sun.tools.javac.comp.Attr.selectSym(Attr.java:1938)
[javac] at com.sun.tools.javac.comp.Attr.visitSelect(Attr.java:1835)
[javac] at com.sun.tools.javac.tree.JCTree$JCFieldAccess.accept(JCTree.java:1522)
[javac] at com.sun.tools.javac.comp.Attr.attribTree(Attr.java:360)
[javac] at com.sun.tools.javac.comp.Attr.attribExpr(Attr.java:377)
[javac] at com.sun.tools.javac.comp.Annotate.enterAttributeValue(Annotate.java:190)
[javac] at com.sun.tools.javac.comp.Annotate.enterAnnotation(Annotate.java:167)
[javac] at com.sun.tools.javac.comp.MemberEnter.enterAnnotations(MemberEnter.java:743)
[javac] at com.sun.tools.javac.comp.MemberEnter.access$300(MemberEnter.java:42)
[javac] at com.sun.tools.javac.comp.MemberEnter$5.enterAnnotation(MemberEnter.java:711)
[javac] at com.sun.tools.javac.comp.Annotate.flush(Annotate.java:95)
[javac] at com.sun.tools.javac.comp.Annotate.enterDone(Annotate.java:87)
[javac] at com.sun.tools.javac.comp.Enter.complete(Enter.java:485)
[javac] at com.sun.tools.javac.comp.Enter.main(Enter.java:442)
[javac] at com.sun.tools.javac.main.JavaCompiler.enterTrees(JavaCompiler.java:819)
[javac] at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:727)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:353)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:279)
[javac] at com.sun.tools.javac.main.Main.compile(Main.java:270)
[javac] at com.sun.tools.javac.Main.compile(Main.java:69)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[javac] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javac] at java.lang.reflect.Method.invoke(Method.java:597)
[javac] at org.apache.tools.ant.taskdefs.compilers.Javac13.execute(Javac13.java:56)
[javac] at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1065)
[javac] at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:882)
[javac] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
[javac] at sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)
[javac] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[javac] at java.lang.reflect.Method.invoke(Method.java:597)
[javac] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
this is my ini file which i have.
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize1024m
--vm
C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe -vmargs -Xms512m -Xmx1024m
I have no idea why it wont use the memory I am giving it. Do i need to do anything else to change the heap size?
Thanks
Not Eclipse is running out of memory, but ant. Ant is run as an external tool from eclipse, so it does not inherit the VM settings you are using for eclipse. You can set the options for it in the external tool run configuration. Go to Run -> External Tools -> External Tool Configurations... Then under "Ant Builds" you have to look up your ant build, and you can set the vm arguments in the JRE tab.
your eclipse.ini settings will take effect only if u change following:
Run -> External Tools -> External Tool
Configurations. go to configuration that u use, under jre tab -select option
Run in same JRE in workspace
this worked 4 me
See this topic with best Eclipse JVM settings
You can properly set the -Xms512m -Xmx1024m options to the Ant bin/sh script that Eclipse will run once you launch a build.
Go to your Eclipse folder
Go to plugins > org.apache.ant_<version> > bin
Modify the OS related Ant file
For Windows: Add this line to the ant.bat file export ANT_OPTS=-Xmx512m
For Unix/Mac OS X: You can directly edit the ant_exec_command command at the end of the ant file or setting the $ANT_ARGS variable
I had the same problem a week ago, and the solution was set fork attribute to true, to run javac in a separate process with its own heap size settings.
If fork is set to false, or not set (default is false), javac will run in the same process as Ant. The following is a snippet from my current build.xml:
<javac fork="true"
srcdir="${basedir}/src"
.....
</javac>
Setting fork to true will also limit any memory leaks in javac implementation to its own child process, without affecting the parent Ant process.
I read about this hint here

Categories

Resources