Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 846782 - dev-java/ant-core-1.10.9-r4 cannot build packages on JDK 8: org/apache/tools/ant/launch/Launcher has been compiled by a more recent version of the Java Runtime
Summary: dev-java/ant-core-1.10.9-r4 cannot build packages on JDK 8: org/apache/tools/...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
Depends on:
Blocks: 847304
  Show dependency tree
Reported: 2022-05-21 18:00 UTC by Yuan Liao (Leo3418)
Modified: 2022-06-28 17:18 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---

dev-java/jna-4.2.2-r3 build.log (dev-java:jna-4.2.2-r3:20220521-054931.log,3.73 KB, text/plain)
2022-05-21 18:00 UTC, Yuan Liao (Leo3418)
dev-java/commons-lang-2.6-r2 build.log (dev-java:commons-lang-2.6-r2:20220521-054213.log,3.35 KB, text/plain)
2022-05-21 18:01 UTC, Yuan Liao (Leo3418)

Note You need to log in before you can comment on or make changes to this bug.
Description Yuan Liao (Leo3418) 2022-05-21 18:00:04 UTC
The Java class files installed by dev-java/ant-core-1.10.9-r4 are on version 53.0 because the package depends on >=virtual/jdk-1.9:* rather than >=1.8.

This will cause the following error when merging ebuilds that strictly depend on virtual/jdk:1.8 (instead of >=virtual/jdk-1.8:*) and rely on dev-java/ant-core for the build process.  These ebuilds always use JDK 1.8 as the build VM.  JDK 1.8 only supports class file versions up to 52.0, so in this situation, Ant cannot run properly to build the project:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/apache/tools/ant/launch/Launcher has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(
	at Method)
	at java.lang.ClassLoader.loadClass(
	at sun.misc.Launcher$AppClassLoader.loadClass(
	at java.lang.ClassLoader.loadClass(
	at sun.launcher.LauncherHelper.checkAndLoadMain(

Example ebuilds that depend on virtual/jdk:1.8 (instead of >=virtual/jdk-1.8:*) and dev-java/ant-core, and cannot be built by dev-java/ant-core-1.10.9-r4 include:
- dev-java/jna-4.2.2-r3
- dev-java/commons-lang-2.6-r2
The build log for each ebuild will be attached below in separate comments.
Comment 1 Yuan Liao (Leo3418) 2022-05-21 18:00:34 UTC
Created attachment 779693 [details]
dev-java/jna-4.2.2-r3 build.log
Comment 2 Yuan Liao (Leo3418) 2022-05-21 18:01:00 UTC
Created attachment 779696 [details]
dev-java/commons-lang-2.6-r2 build.log
Comment 3 Larry the Git Cow gentoo-dev 2022-05-21 18:19:58 UTC
The bug has been referenced in the following commit(s):

commit b24498c7e502a18bac9b4f42e94bf479bb96a34c
Author:     Florian Schmaus <>
AuthorDate: 2022-05-21 18:17:55 +0000
Commit:     Florian Schmaus <>
CommitDate: 2022-05-21 18:17:55 +0000

    dev-java/ant-core: lower min Java to 8 again
    Turns out that raising ant-core's min Java requirement to 9, while
    fixing bug #831290, renders ant unable to build pure Java 8 packages (of
    which we have a few, most prominently jna), see bug #846782.
    We go back to Java 8 again, until we find a better solution.
    Signed-off-by: Florian Schmaus <>

 .../ant-core/{ant-core-1.10.9-r4.ebuild => ant-core-1.10.9-r5.ebuild}   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)