You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am dealing with a project that requires a large number of entries in a class path, which results in very large command line values for the -classpath argument. Given the limitation on certain platforms (windows) for command line length, the solution for our java projects is to create a manifest-only jar, which has a class-path entry pointing to all of the dirs/jars required in the build.
The issue I have encountered is what appears to be an inability in scalac to properly load the referenced entries contained in a manifest-only jar.
Given the java class:
packagea.b.c;
public classSimpleJava {
public String toString() {
returnSimpleJava.class.getName();
}
public static void main(String[] args) {
System.out.println("hello from jar");
}
}
Compiled and packaged into a jar (thejar.jar) and then create a manifest-only jar (manifestjar.jar) that references the jar containing SimpleJava
=== What is the expected behavior? ===
The expectation would be that scalac would examine the classpath entries' manifest to see if there is a class-path entry and if so load the referenced dirs/jars for use in the compile.
=== What do you see instead? ===
The compile fails with 'not found' errors for elements referenced in the manifest-only jar.
=== What versions of the following are you using? ===
Scala: 2.8.1
Java: 1.6.0_24
Operating system: Mac OS X 10.6.6 (10J567)
The text was updated successfully, but these errors were encountered:
Then if a Class-Path attribute is present in the jar manifest, the
classpath will be constructed from that instead of the arguments. Some
things remain to be determined, like whether it's supposed to replace
a classpath given on the command line or supplement it, and whether
the master jar should be on the classpath or only and exactly the jars
listed in the manifest.
There's a really nice test case, which won't be run of course, but I
can't stand going any further without tests for these hard to test on
all platforms things. The faux .check file shows what I see.
I am dealing with a project that requires a large number of entries in a class path, which results in very large command line values for the -classpath argument. Given the limitation on certain platforms (windows) for command line length, the solution for our java projects is to create a manifest-only jar, which has a class-path entry pointing to all of the dirs/jars required in the build.
The issue I have encountered is what appears to be an inability in scalac to properly load the referenced entries contained in a manifest-only jar.
Given the java class:
Compiled and packaged into a jar (thejar.jar) and then create a manifest-only jar (manifestjar.jar) that references the jar containing SimpleJava
Given scala object Sample:
The command 'scalac -classpath ./manifestjar.jar Sample.scala' produces:
Sample.scala:1: error: not found: value a
import a.b.c.SimpleJava
^
one error found
Where: scalac -classpath ./thejar.jar .Sample.scala succeeds.
=== What is the expected behavior? ===
The expectation would be that scalac would examine the classpath entries' manifest to see if there is a class-path entry and if so load the referenced dirs/jars for use in the compile.
=== What do you see instead? ===
The compile fails with 'not found' errors for elements referenced in the manifest-only jar.
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: