Java 1.5.0_06 Compiler Problems on Solaris

Hello.

I have some problems compiling my sources with Java Compiler javac in version 1.5.0_06 on Solaris 10. The application has to be compiled with library files from the Oracle OC4J 10.1.2 Server. When running the compilation, the following error occurs:

[javac] The system is out of resources.

[javac] Consult the following stack tracefor details.

[javac] java.lang.OutOfMemoryError

[javac]at java.util.zip.ZipFile.open(Native Method)

[javac]at java.util.zip.ZipFile.<init>(ZipFile.java:203)

[javac]at java.util.zip.ZipFile.<init>(ZipFile.java:84)

[javac]at

com.sun.tools.javac.jvm.ClassReader.openArchive(ClassReader.java:1439)

[javac]at

com.sun.tools.javac.jvm.ClassReader.list(ClassReader.java:1742)

[javac]at

com.sun.tools.javac.jvm.ClassReader.listAll(ClassReader.java:1882)

[javac]at

com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1905)

[javac]at

com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1538)

[javac]at

com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)

[javac]at

com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:256)

[javac]at

com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:382)

[javac]at

com.sun.tools.javac.comp.Enter.classEnter(Enter.java:221)

[javac]at

com.sun.tools.javac.comp.Enter.classEnter(Enter.java:235)

[javac]at com.sun.tools.javac.comp.Enter.complete(Enter.java:448)

[javac]at com.sun.tools.javac.comp.Enter.main(Enter.java:433)

[javac]at

com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:403)

[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)

First thing i did was to extend the memory settings in the ant compilation task to:

<javac srcdir="${dir.src}"

destdir="${dir.classes}"

executable="${path.to.javacompiler}"

debug="on"

fork="true"

memoryInitialSize="512M"

memoryMaximumSize="512M"

encoding="UTF-8"

source="1.4"

target="1.4"

sourcepath="${dir.bean.src}/src/">

<classpath refid="web.classpath" />

</javac>

But this didn't work. Using the explicit library names in ant and not the entire directory (j2ee/home and j2ee/home/lib) works for 1.5.0_06! So my thought was, that the used classpath is too long or one of the library files may be damaged (because of the "java.util.zip.zipFile"-Class shown in the stacktrace). The strange thing is, when I compile the sources with an older version of javac (e.g. 1.4.x), the compilation works great.

Does anyone have similar experience with this problem?

Greetings and best regards,

Daniel

[3323 byte] By [Zodaka] at [2007-10-3 2:13:12]
# 1

I am currently dealing with the same problem. I am porting our build tree (building J2EE app using ant) to Java 5. I am trying to port Linux builds now, and am seeing the problem you describe. I have not yet attempted Solaris. I was able to get a successful Java 5 build on Windows by using the "-J" flag, but this flag does not appear to exist on Solaris or Linux, so I am scouring these forums looking for a solution...

Anyone?

screen_name_004a at 2007-7-14 19:12:03 > top of Java-index,Developer Tools,Java Compiler...
# 2
I have notice something else: I seem to have the problem when compiling incrementally, but not when compiling from scratch. Can you clean your build and try compiling everything at once?
screen_name_004a at 2007-7-14 19:12:03 > top of Java-index,Developer Tools,Java Compiler...