简体   繁体   中英

Upgrading from Intellij 2020.1.2 to IntelliJ 2021.2.3 Issue when use with Java Play 2.2

I am upgrading my IDE from IntelliJ 2020.1.2 to IntelliJ 2021.2.3.

My project uses a pretty old Java Play library, play_2.10-2.2.0.jar , which by default, it will retrieve messages from its own jar.The below image captures what is present in the play jar, where messages is placed in the root directory. 在此处输入图像描述

And when I started to run the application using IntelliJ, instead of retrieving the messages file correctly from.m2 play folder as specified in pom.xml, it gets the IntelliJ runtime jar as shown below.

在此处输入图像描述

Which of course, creates the issue. This is an issue previous IDE does not have.

And it seems there is a crash of classpath here. How can I ensure play jar classpath as always override intellij one? [Though I believe other exception may arise in case if IntelliJ cannot found the message folder properly.

When I use java command, I can always ensure the order by specifying -classpath order. How can I do the same in IntelliJ? Specifying it in Project Structure modules may not be helpful, as it seems IntelliJ runtime jar is never present here.

Is there any solution for solving the issue?

Thanks.

After some research, I found that by setting bin/idea.properties in IntelliJ setting.

idea.no.launcher=true

The code work as expected.

Solution are found in Running ScalaTest in IntelliJ removes everything but idea_rt.jar from classpath .

This solution solves the solution as it prevents IntelliJ runtime jar to be executed in IntelliJ executed java program.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM