intellij doesn't recognize jvm when I try to configure jdk - intellij-idea

I'm working on mint-cinnamon as my file-system and running intellij on it,
I'm trying to add jdk to intellij but when i'm looking for it trough intellij it doesn't show any jdk nor jvm file though I know that these files exist (open jdk 8 and open jdk 11 and jvm) and I know where they are.
I've tried reinstall jdk11 and 8, rebuild the project, and download lib32.
enter image description here
enter image description here, enter image description here

try: Project structure -> Platform settings -> SDKs
Then add the path to the jdk.
After that got to Project under Project settings and select the project SDK.
I've worked with mint and intellij, and had no problems.

Related

IntelliJ error - could not open init generic class cache for initialization script

enter image description here
enter image description here
I was trying to download IntelliJ and learn Kotlin, but i get a BUG error before i am starting, and i dont now what to do..
I have try to delete the scipts folder, but it just make a new scipts folder, and say the same error. I have also reinstall IntelliJ, and thats give the same error.
Is der someone there can help me? :-)
Could not open init generic class cache for initialization script 'C:\Users\username\AppData\Local\Temp\wrapper_init4.gradle' (C:\Users\username.gradle\caches\6.6.1\scripts\3yb5naxddghzghazzdf2vk0em).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
As per the details in your error message, you can see that the root cause is a gradle error.
Gradle is likely using an unsupported version of the JVM in your case (e.g. I could reproduce the error in the latest IntelliJ 2021.3 version where gradle was using JVM 17 from my home path, while the IDE itself was using JDK 11.) In the attached IntelliJ Preferences screen, note that the JVM used by Gradle is specified separately.
To fix the error, verify the JVM version being used by gradle and specify a JVM 11 version to gradle.
IntelliJ Gradle Preferences Screenshot:
You should set these options when you create your project enter image description here
Or, when creating a project, choose Java - Kotlin\JVM
For me this problem occurred when i was using wrong JDK file to build the project that is the Gradle JDK used was a normal SE JDK rather than one preferred by Android Studio so you follow the following steps to solve it.
Go to Settings (ctrl + alt + s)
Go to Build,Execution and Deployment
Then select Build Tools > Gradle
Change Gradle JDK to jbr-17 (the one i am using) you can prefer to choose options from Android studio Java Home or Default JDK

How to get jrebel, jetty, gradle and intellij idea working together

I have installed JRebel plugin for Intellij Idea and my project is running with Jetty gradle plugin.
I run my project with "Run with JRebel", project perfectly runs, but hot swap which i expected is not working.
Does anybody have an understandable and detailed instruction how to set up Jrebel for work with jetty, gradle and intellij idea?
1) You need to add JRebel Agent as a vm argument into Jetty.
Depending on your environment:
Windows 64-bit JDK jrebel64.dll
Windows 32-bit JDK jrebel32.dll
Mac OS X 64-bit JDK libjrebel64.dylib
Mac OS X 32-bit JDK libjrebel32.dylib
Linux 64-bit JDK libjrebel64.so
Linux 32-bit JDK libjrebel32.so
You need to add -agenthpath argument in gradle.properties file:
org.gradle.jvmargs=-agentpath:[c:\path\to\]lib\jrebel64.dll
2) You need to generate rebel.xml files for your projects in JRebel IDE plugin
Right-click on the project node in the Project View and select JRebel > rebel.xml. Alternatively, you can check projet in JRebel Modules window
3) You need to deploy(run) your projects into the Jetty with rebel.xml configuration files and when you make a code change in a .java file you need to generate new .class file. IntelliJ IDEA does not compile classes on save by default. Press Ctrl+Shift+F9 to compile the current file, module or package (you can also find this command via Build > Make Project).

Intellij plugin development "the selected directory is not a valid home for intellij platform plugin sdk"

I'm following these guidelines on how to develop Intellij plugin.
So I
Open project settings.
Project SDK --> New
Choose the community edition path I just downloaded
Expected the directory is selected fine.
Actual: I get the error message:
"the selected directory is not a valid home for intellij platform plugin sdk"
See screenshot:
Am I doing something wrong?
Thanks
Intellij platform plugin sdk home should be your installed or builded IntelliJ, not sources. You can add that intellij-community folder as sources to your IntelliJ SDK later or not at all.
Goto Intellij installed directory
C:\ProgramFiles\JetBrains\IntelliJ IDEA Community Edition 2016.3.4
Select plugin folder
Create a directory (eg: scala)
Copy the scala lib folder
Restart the intellij
In my case, I had to download a newer IDEA version (Community Edition) and after the installation, everything worked fine.
This is the official and updated link for setting up your plugin development environment.

IntelliJ IDEA 12 Android slow response

When I type in the IntelliJ Editor I get major lags from multiple seconds, until my typed word gets displayed.
I'm running IntelliJ with Maven and Git to build Android Projects.
idea.exe, idea64.exe and idea.bat did produce the same issues.
My mistake was to apply the Android SDK in my Project settings.
Goto File | Project Structure | SDKs
Remove all Android related SDK's
Add only your default Java JDK like JDK 1.7 (default under: C:\Program Files\Java\)
Goto the Modules Tab
Apply the JDK to all modules or set ProjectSDK as it should now be the JDK1.7
As I tried to solve this problem for several days including adding the IDEA_JDK Variables
I thought sharing this solution could be helpful

Intellij project between Windows and Linux - use the 'default system provided' JDK?

I've got two dev workstations, one running Windows, the other running Linux. I work on a Java project using Intellij on both. Both platforms have the Oracle JDK 7 installed in the default locations.
For some annoying reason, every time I switch platforms, I need to update the project configuration to specify what JDK it should be using. In the project's "Project SDK" setting, there's a JDK selection which includes two entries - 1 for a JDK in c:\Program Files\Java\jdk_1.7 and the other for a JDK in /usr/lib/jvm/java-7-jdk/. If I open the project on Linux, I have to specifically set the Project JDK to be the second. If I save the project, close, commit, and then checkout and open on Windows, it complains it can't find the JDK, and I have to manually set it to the Windows version.
Why can't Intellij figure this out automatically? I appreciate that testing against multiple installed JDKs is a useful feature, but is there a way to tell a project to 'just use the default JDK'?
You need to have your JDK configurations to have the same name, lile 1.6 or 1.7. Project file references JDK by its name only so it will work out of the box in all IDEA installations on different operation systems, the only requirement is that there is JSDK defined under exactly the same name.