JDK-6456960 : java 1.5.0_07compiler reports JVM out of memory error when MANIFEST classpath el
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 5.0u7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_2.5.1
  • CPU: sparc
  • Submitted: 2006-08-03
  • Updated: 2010-04-02
  • Resolved: 2006-08-03
Related Reports
Duplicate :  
Relates :  
Description
In our project I have dependent jar files added as MANIFEST classpath entries. The jars have cyclic depedency upon other jars. All these dependencies are specified as MANIFEST classpath entries.

When compiling my code using Javac 1.5.0_07 I get "JVM out of memory" error. When run using -verbose option you can observe that "search path for class files" keeps on expanding infinitely. Utlitimately JVM reports out of memory error.

I tried reproducing it using a simple code. Keep three jars say a.jar, b.jar and c.jar having cyclic dependency in their MANIFEST files.

MANIFEST files of these jars are following:
a.jar:
Manifest-Version: 1.0
Specification-Title: "a.jar"
Class-Path: ../../tmp/temp/c.jar
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
Implementation-Title: "a"

b.jar:
Manifest-Version: 1.0
Specification-Title: "b.jar"
Class-Path: ../../tmp/temp/a.jar
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
Implementation-Title: "b"

c.jar:
Manifest-Version: 1.0
Specification-Title: "c.jar"
Class-Path: ../../tmp/temp/b.jar
Created-By: 1.5.0_06 (Sun Microsystems Inc.)
Implementation-Title: "c"

Set the classpath to "<basedir>/tmp/temp/a.jar".

Have a java file say D.java which depends upon classes present in a.jar. Now invvoking "javac D.java" reports "Zip file name too long" error. The actual javac output is mentioned at the end.

The error reported here is "Zip file Name too long" and not "out of memory" but underlying problem is the same. If you run javac with -verbose option you will find that "search path for class files" keeps on expanding infinitely. Utlitimately error is reported.

This problem looks similar to bug# 6400872 (REGRESSION: Java Compiler cannot find jar files referenced by other) but this bug is filed on 1.6 beta.


JAVAC OUTPUT:
============================

error: error reading /tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/../../tmp/temp/b.jar; zip file name too long
1 error