In my Intellij project I started not being able to run the application anymore, with ClassNotFoundException for the spring-boot application main class (even though it runs fine from command line) and also
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.InternalError: java.util.zip.ZipException: zip END header not found
As suggested in other answers, I have tried the following
Uninstalled and reinstalled intellij.
Deleted my local .m2 repository and reinstalled my maven application.
But when I go to the project Open dialog and point to the pom.xml it just silently closes down the window. Why does this happen?
Related
i've created a project with Jhipster, when i open the project with IntelliJ i have these problems in pom.xml:
pom.xml problems
I tried maven clean/package/install, the first two run successfully but when i run maven install a test fails:
test failure
I also tried to use plugin registry (in maven settings) and invalidate caches but still not work. In the end i tried different JDK but i have the same problems. Can someone help me please?
I use JDK 11.0.15, Node 16.15.1, Git 2.36.1 and i'm on windows 10.
For those interested in troubleshooting pom.xml i solved by updating the repository (on IntelliJ go file/settings/build, execution, deployment/build tools/maven/repositories both remote and local) and reloading all maven projects.
Lately (even after cache cleanup/reinstalls) I have issues with idea, where builds are failing, run configuration is failing. The problem is, that it is idea thing, maven builds just fine, run from cli runs just fine.
In idea I already checked "delegate build/run configurations to maven", and run configuration does not have any action to be done before build. Yet for some reason when I click run, it tries to download some libraries and then it fails. Second later java -jar from cli using previously outside of intellij build jar WORKS.
How to turn all these clever (and for me dysfunctional) stuff? I just want idea to run java -jar and that's it to minimize number of places, where it can fail. I know about possibility starting code externally from java and just connect with debugger, but I'd like to avoid it as it is not that convenient, and if I have ultimate edition, I'd like to be able to start debugging session from ide.
EDIT:
maven project is freshly updated, jdk is the same as one used maven. Yet for some reason project run produces:
java.lang.IllegalStateException: Error processing condition on org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration.propertySourcesPlaceholderConfigurer
Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration] from ClassLoader
Caused by: java.lang.NoClassDefFoundError: javax/servlet/Filter
second later, java -jar using fat jar works.
This error keeps happening every once in a while in my Kotlin projects. I tried several Kotlin versions (1.3.41, 1.3.60, 1.3.72) but this seems to come up on any version and in various projects. Once it starts happening, I can't build any project.
Full error message:
Unable to load class 'kotlin.coroutines.Continuation'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt.
Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
I have tried all the suggestions and none of it helped. When I click
"Re-download dependencies and sync project (requires network)", it says
Clicking "Stop Gradle build processes (requires restart)" restarts Intellij but doesn't help.
Closing Intellij and killing Java processes didn't help either.
While none of the linked suggestions in the error popup worked, running 'clean' gradle task manually did do the trick!
./gradlew clean
The error still comes up every once in a while but can be reliably fixed by running gradle clean.
I have updated my IntelliJ IDEA Ultimate to the 2016.2 version.
I had a Grails 3 project and now when I open the IDE I get the following error when trying to run my project:
Error running Grails: My_Project: Grails application is not found
I can still open the terminal and run the project manually, but it seems that IntelliJ IDEA no longer recognises my Grails application. When going to "Edit configurations...", in "Application" it says "[none]" and I can't select anything.
Grails Version: 3.1.9
Groovy Version: 2.4.7
JVM Version: 1.8.0_66
A Simple solution to this is to refresh the gradle projects.
You can do this by popping out the little gradle tab and hitting the "Refresh All Gradle Projects"
I run into the same problem always when i restart intellij. Running grails clean command from the terminal fixed it.
First, re-import the project into IntelliJ 2016.2. Choose the build.gradle file for the import. Use the gradle wrapper or a local gradle installation, where you have given IntelliJ the path to the locally installed Gradle. Let IntelliJ re-index everything. Wait until you see no further indexing on the bottom of the screen.
Second, run the application once, with no edit configuration. After this completes with error, you should be able to choose Run -> Edit Configuration / Application.
Third, you can go into the project pane to the grails-app/init/app-name/Application.groovy file and right-click on that and choose Run. After that, an edit configuration will be created.
Finally, you can try to invalidate cache and restart. (This has nothing to do with Edit Configuration, but sometimes the gradle and/or .idea caches get out of sync.)
I had the same problem after updating to IntelliJ Ultimate 2019.2.
It seems that the "little gradle tab" of the accepted answer no longer exists.
The reason in my case was that the Gradle Plugin had been disabled by the update process.
Resolution: Hit Help > Find Action > Type gradle. You should see a line "Gradle" and a ON-OFF switch at the end of that line.
Enable it and restart IntelliJ solved my problem.
I have a libGDX project generated by the gdx-setup.jar tool, including core, android, desktop, and html modules. I hadn't touched any of the gradle files, and my build has worked fine for some weeks.
This morning when I opened IntelliJ IDEA (build 135.1230), it offered to update the Scala plugin, so I accepted and restarted, before trying to open the project. My libGDX project doesn't use Scala at all: I have the plugin for other work. When I tried to open the project, I got the infamous "Gradle project sync failed. Basic functionality (e.g. editing, debugging) will not work properly" message. Clicking "Try again" thinks for a bit before showing the same message. The Event Log window contains no output, and the Messages window says:
Error: (of class java.lang.String)
The Scala plugin isn't the only thing that might have changed: I've rebooted the (Ubuntu) machine since the project last worked, so it's possible that some package updates might have only just had an effect.
Following the advice of others, I've tried editing the root gradle.properties to change org.gradle.configureondemand to false, and that made no difference. I've tried performing "Build → Clean Project" and "Invalidate and Restart", with the same effect. I've also tried running git clean -X and reimporting the Gradle project into IDEA, but I just get a "Resolve error" dialog with the same message as above.
Running a build command like
./gradlew android:assemble
from a shell still works fine: only IntelliJ IDEA has a problem.
Even if you've never seen this particular problem, I'd appreciate any tips on where to start debugging it. The error message doesn't exactly give me a lot to go on.