Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JDime does not build under Java 8 or Java 11 #22

Closed
mernst opened this issue Oct 15, 2023 · 4 comments
Closed

JDime does not build under Java 8 or Java 11 #22

mernst opened this issue Oct 15, 2023 · 4 comments

Comments

@mernst
Copy link

mernst commented Oct 15, 2023

I tried to use the following commands to install JDime:

mkdir -p ~/tmp
cd ~/tmp
rm -rf jdime JNativeMerge
git clone https://github.com/se-sic/jdime.git
cd jdime
./gradlew installDist

Under Java 8, I get the error:

FAILURE: Build failed with an exception.

* What went wrong:
org/eclipse/jgit/storage/file/FileRepositoryBuilder has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Running ./gradlew --debug installDist gives (among voluminous other output):

[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for org.eclipse.jgit:org.eclipse.jgit:[4.8.0.201706111038-r,) using repositories [Gradle Central Plugin Repository]
[DEBUG] [org.gradle.cache.internal.DefaultCacheAccess] Creating new cache for metadata-2.53/module-versions, path /home/mernst/.gradle/caches/modules-2/metadata-2.53/module-versions.bin, access org.gradle.cache.internal.DefaultCacheAccess@3bfeacf
[DEBUG] [org.gradle.cache.internal.btree.BTreePersistentIndexedCache] Opening cache module-versions.bin (/home/mernst/.gradle/caches/modules-2/metadata-2.53/module-versions.bin)
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Using cached module metadata for module 'org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r' in 'Gradle Central Plugin Repository'
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Using org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r from Maven repository 'Gradle Central Plugin Repository'
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for org.eclipse.jgit:org.eclipse.jgit.ui:[4.8.0.201706111038-r,) using repositories [Gradle Central Plugin Repository]
[DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Using cached module metadata for module 'org.eclipse.jgit:org.eclipse.jgit.ui:6.7.0.202309050840-r' in 'Gradle Central Plugin Repository'
...
[DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match org.eclipse.jgit:org.eclipse.jgit.ui:6.7.0.202309050840-r configuration runtime from candidates [org.eclipse.jgit:org.eclipse.jgit.ui:6.7.0.202309050840-r configuration runtime] for {}
[DEBUG] [org.gradle.internal.component.model.ComponentAttributeMatcher] Selected match org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r configuration runtime from candidates [org.eclipse.jgit:org.eclipse.jgit:6.7.0.202309050840-r configuration runtime] for {}

Class file version 55.0 corresponds to Java 11, so I tried building under Java 11, but that gave a different error:

* What went wrong:
Could not determine java version from '11.0.20.1'.
@GSeibt
Copy link
Collaborator

GSeibt commented Oct 19, 2023

Hi,

not sure about Could not determine java version from '11.0.20.1'. but I updated the develop branch to use Gradle 8.4 and the latest plugins + dependencies. I am using Java 11 for running Gradle and Gradle downloads Java 8 (Temurin) for building now.

Works for me. Can you give it a try?

Also, please use the develop branch. I set that as the default now.

Best,
Georg

@mernst
Copy link
Author

mernst commented Oct 19, 2023

Georg, thanks for your reply.

Unfortunately, I am still suffering this error when running ./gradlew installDist:

* What went wrong:
Could not determine the dependencies of task ':installDist'.
> Could not resolve all dependencies for configuration ':runtimeClasspath'.
   > Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
      > No matching toolchains found for requested specification: {languageVersion=8, vendor=ADOPTIUM, implementation=vendor-specific} for LINUX on x86_64.
         > No locally installed toolchains match and toolchain download repositories have not been configured.

Here is how you can reproduce the prolem:

docker run -it adoptopenjdk/openjdk11 /bin/bash
apt-get update
apt install -yq git
git clone -q https://github.com/se-sic/jdime /tmp/jdime
cd /tmp/jdime
which java && java -version
./gradlew -q installDist

@GSeibt
Copy link
Collaborator

GSeibt commented Oct 20, 2023

Hm, seems one has to configure how to download toolchains now. I added the appropriate plugin on the development branch.

@mernst
Copy link
Author

mernst commented Oct 24, 2023

That worked, thanks.

@mernst mernst closed this as completed Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants