In our project we specify Java 5 (for backwards compatibility) and run Maven
using Java 5, so we can catch errors where code inadvertently depends on methods
not in Java 5 but rather, introduced in Java 6. Merely setting the Maven
compile source and target to 1.5 doesn't catch these kinds of errors.
For example, in Java 6 a method was added to the String class for getBytes(...)
which takes an argument of Charset.
This method is not in Java 5.
The Felix bundle (release 2.3.5) appears to use this very method, and, thus,
requires Java 6 to run it, because after switching to 2.3.5, I see an exception
with this traceback:
Caused by: java.lang.NoSuchMethodError:
java.lang.String.getBytes(Ljava/nio/charset/Charset;)[B
at aQute.lib.osgi.Jar.<clinit>(Jar.java:290)
at
org.apache.felix.bundleplugin.BundlePlugin.getClasspath(BundlePlugin.java:942)
at
org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:261)
at
org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:252)
at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
Is this intentional (that Java 6 is a requirement to run the
maven-bundle-plugin)?
-Marshall Schor
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]