Change intellij JVM - intellij-idea

I saw a comment about fixing an issue with the Intellij
"The problem should not occur if you switch Java used by the IntelliJ IDEA from OpenJDK bundled with IDEA to Oracle JVM. At least this can work as a workaround."
How can I change the JVM in Intellij ?

Set an environment variable to tell IntelliJ what JVM to use for the IDE.
Go into Control Panel...System...Advanced System Settings. Click the "Advanced" tab, then click the "Environment Variables" button to edit.
Add a new user variable -
"IDEA_JDK" for a 32-bit JVM, or "IDEA_JDK_64" for a 64-bit JVM. Set the variable to point to the directory of the JDK you want IntelliJ to use (e.g., "C:\Java\jdks\1.8x64" or similar)
Restart IntelliJ.

The procedure is described here:
Open the Find Action popup using ctrl+shift+A
Type switch and select Switch Boot JDK
Select an existing JDK in the dropdown (use ... to select a custom path)
Reboot the IDE

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

Access Terminal in IntelliJ Enterprise edition 2017

I'm on a windows 10 64 bit box. I need to open the terminal inside intellij 2017.1. According to google the key command for this is alt-F12 but that combination of keystrokes does nothing apparent for me.
Is there an alternative way to open the console inside intellij that I might be overlooking?
Thanks!
It has clearly explained in the documentation provided by the JetBrains.
To find the terminal related details please use the following link.
IntelliJ IDEA Terminal
If you want to configure the key bindings please refer the following
link.
IntelliJ IDEA Keyboard Shortcuts
That shortcut is correct, to run embedded local terminal press Alt + F12. But you should make sure that the Terminal plugin is enabled. The plugin is bundled with IntelliJ IDEA and is activated by default, if it is not the case, you can enable it, go to Settings > Preferences > Plugins

Commenting code out/in IntelliJ IDEA german keyboard

After updated IntelliJ IDEA to 2017.1, I can not any more comment out/in code. I am using a german keyboard and until yet i could use a workaround to comment code in/out with the shortcut "CMD" + "-" but now it isn't working any more. The shortcuts "CMD" + "/" isn't working.
Any ideas to solve this problem on a german keyboard?
You can either reassign this action to the working shortcut in the Keymap preferences or use this workaround:
Install JB SDK Bintray Downloader plugin. You can find it in the plugin repository right in the IDE settings.
Find the action "Get JB SDK from BinTray" (On Mac you can use Cmd + A shortcut to find the action by name)
Choose appropriate Runtime version (build 795 or later)
Download it
Install it
Restart IntelliJ IDEA (it should happen automatically)
Check the IDE About dialog to be sure that the IDE is bootstrapped with the desired version of the runtime
To enable OpenJDK behavior go to Help | Edit Custom Properties, add the following property into the file:
com.jetbrains.use.old.keyevent.processing=true

How do I change the JVM used to run IntelliJ on Windows

I have two Java JDKs installed on my workstation, with jdk1.6.0_41 in my path, and jdk1.7.0_21 available as well, but not in the path.
How can I configure IntelliJ IDEA 13 to use a particular JVM? To be clear, I want to set the JVM used to run IntelliJ itself, not the SDK used for running my code. I am running Windows 7 Enterprise Edition and launch IntelliJ 13.0.2 by running idea64.exe
I have set JAVA_HOME to point to jdk1.7.0_21 but according to the About box it is using jdk1.6.0_41.
This FAQ on the JetBrains web site describes how to do this for Mac, but not for Windows.
This answer suggests using the IDEA_JVM environment variable for Ubuntu 12, but I have tried that and it isn't working.
I suspect you have another setting that is overriding your JAVA_HOME
From Jetbrains docs:
idea64.exe uses this JDK search sequence:
IDEA_JDK_64 environment variable
..\jre64 directory
system Registry
JDK_HOME environment variable
JAVA_HOME environment variable
With newer versions the environment variables are ignored. Instead there is a new action "Choose Boot Java Runtime". The easiest way to get to it is via "Find Action" Ctrl+Shift+A.
You can also edit the setting via the .jdk file in your user configuration directory, e.g. %APPDATA%\JetBrains\IntelliJIdea2021.3\idea64.exe.jdk. This is a plain text file containing only the path to the JDK.
It is not recommended to do this, and you should use the JDK that is bundled with IDEA.
CTRL+ALT+SHIFT+S to go to Project Structure
Under Platform Settings, go to SDKs.
Use the + green icon to add a new SDK and set it to that one.

JProfiler not working in IntelliJ 12 (JProfiler executable is null)

I'm trying to profile my Android app. I installed the JProfiler plugin through
IntelliJ IDEA --> Preferences --> Plugins
Here's a screenshot of the plugin description:
When I try to run the profiler nothing happens and I get this message saying that the JProfiler executable is null:
Any idea on how to fix this?
You need to set or re-set the JProfiler executable. Do the following:
Select "Edit Configurations" from the "Run" drop down menu
Select "Application" under "Defaults" in the dialog box (or any existing run configuration)
Select the "Startup/Connection" tab
Select "JProfiler" in the list
Click on the "Select JProfiler Executable" button
Choose the JProfiler executable, which is
[JProfiler installation directory]\bin\jprofiler.exe on Windows
[JProfiler installation directory]/bin/jprofiler on Linux/Unix
[JProfiler installation directory]/bin/macos/jprofiler.sh on Mac OS X
You have to install JProfiler first, you can download it here.
You need to have JProfiler 7.2.2 (or newer) which integrates with IntelliJ IDEA 12
http://www.ej-technologies.com/download/jprofiler/changelog.html#7.2.2
To start, in a file browser check if you have the plugins folder, if not create it, so it looks like this
C:\Users\[username]\.IntelliJIdea12\config\plugins
If running IntelliJ IDEA 12, close it.
Inside JProfiler go to
Session -> IDE Integrations
And choose IntelliJ IDEA 12.x and click Proceed button
Choose your .IntelliJIdea12 folder
C:\Users\[username]\.IntelliJIdea12
And you're done, you should see a new button Next to Run [class#method] with Coverage that says Profile [class#method]