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

Minimal changes make IDEA 2023.2 work out-of-box #470

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

shifujun
Copy link
Contributor

Correct maven-compiler-plugin JDK version for IDEA import Compiler bytecode version.

Remove JvstTestRoot's constructor, otherwise IDEA cannot show Run icon aside testMethod. Another way is adding suite() static method to those classes.

Now we can clone and open project with IDEA 2023.2. Debug single test case with IDEA is very useful.

BTW, some test case failed in IDEA due to some file path problem.
image

Correct maven-compiler-plugin JDK version for IDEA import Compiler bytecode version.

Remove JvstTestRoot's constructor, otherwise IDEA cannot show Run icon aside testMethod.
Another way is adding suite() static method to those classes.

Now we can clone and open project with IDEA 2023.2. Debug single test case with IDEA is very useful.
@chibash chibash merged commit f74619e into jboss-javassist:master Dec 16, 2023
2 checks passed
@@ -151,8 +151,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a very significant change,Many JDK8 projects may not be able to upgrade dependencies.
I think this will reduce compatibility, it seems unnecessary.

@chibash
Copy link
Member

chibash commented Dec 18, 2023

OK... I understand that moving to JDK 11 is too early. Shall we move this back to 1.8?

@shifujun
Copy link
Contributor Author

I thought we already needed JDK 11.

java-version: [ 11.0.3, 11 ]

I cannot compile master branch under JDK8. Cannot find com.sun.jdi.

@shifujun shifujun deleted the repair_IDEA branch December 18, 2023 07:22
@wuwen5
Copy link
Contributor

wuwen5 commented Dec 18, 2023

I thought we already needed JDK 11.

java-version: [ 11.0.3, 11 ]

I cannot compile master branch under JDK8. Cannot find com.sun.jdi.

You should at least use JDK-11 for compilation, but the recommended compilation target version is 1.8.

@wuwen5
Copy link
Contributor

wuwen5 commented Dec 18, 2023

OK... I understand that moving to JDK 11 is too early. Shall we move this back to 1.8?

Sure, I agree. I suggest back to 1.8.

For example, this.
https://github.com/mybatis/mybatis-3/actions/runs/7239276219/job/19720962511?pr=3043#step:11:23

At least currently, there are many basic libraries that are compatible with 1.8.

@shifujun
Copy link
Contributor Author

I need some missing knowledge here.

Say if we have a Scratch.java, which refs JDI class.

class Scratch {
    public static void main(String[] args) {
        System.out.println(com.sun.jdi.Bootstrap.class.getName());
    }
}

We can compile it with javac -target 11 Scratch.java, test with javap -c -verbose Scratch.class | grep "major version" | cut -d " " -f5.

But I can't comiple it with javac -J-Duser.language=en -target 8 Scratch.java,
it outputs:
warning: target release 8 conflicts with default source release 11
and NO Scratch.class output.

But I tested output of maven before this PR: javap -c -verbose ./target/classes/javassist/util/HotSwapper.class | grep "major version" | cut -d " " -f5. It is 52. I don't understand how did maven compile it ?

shifujun added a commit to shifujun/javassist that referenced this pull request Dec 18, 2023
IDEA only need compiler.xml set <option name="USE_RELEASE_OPTION" value="false" />.

fix jboss-javassist#470
@shifujun
Copy link
Contributor Author

I figured it out. Please review #473

@Subrhamanya
Copy link

We are having issues upgrading this dependency. There was no documentation/any release notes telling java 8 support is stopped. We really can't upgrade to java 11 suddenly.

shifujun added a commit to shifujun/javassist that referenced this pull request Dec 20, 2023
This project need JDK 11 to compile, but target to JDK 8.

IDEA need uncheck "use --release" in Preferences |
Build, Execution, Deployment | Compiler | Java Compiler
, to build success.

fix jboss-javassist#470
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 this pull request may close these issues.

4 participants