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

JDK version #59

Open
vadiole opened this issue Mar 6, 2024 · 1 comment · May be fixed by #60
Open

JDK version #59

vadiole opened this issue Mar 6, 2024 · 1 comment · May be fixed by #60

Comments

@vadiole
Copy link

vadiole commented Mar 6, 2024

Problem

Is seems like the JDK version used to run detekt is 11.
From Dockerfile:

RUN apk --no-cache --update add git curl openjdk11 bash \
    && rm -rf /var/cache/apk/*

This makes it impossible to run custom detekt rules, compiled with target version higher then 11:

java -jar /opt/detekt.jar --config detekt-ruleset.yml --report xml:detekt_report.xml --excludes **/build/**,**/.idea/** --plugins /opt/detekt-formatting.jar,detekt-custom-rules/compiled-rules.jar 
java.lang.UnsupportedClassVersionError: com/project/detektcustomrules/RuleSetProvider has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 55.0

Question

Could there be a way to bump/specify a java version for the action?
Is there something behind the choice of version 11, or could it be changed easily?

@alaegin
Copy link
Owner

alaegin commented Mar 7, 2024

Hello!

Thanks for the report. I think we can upgrade Java version to 17. (According to this table)

The reason for jdk 11 is that I copied this Dockerfile from my internal tools several years ago. It was created for the older version of Detekt where jdk 11 was a requirement

@alaegin alaegin linked a pull request Apr 15, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants