how can i set the jdk in intellij 9 on mac - macos

I have a project on intellij and now i wanna run it on intellinj 9 on mac. when i run the project i get the error -> "the JDK is not specifiedfor module "XXXXX" specify the JDK in Configuration project". when i go there in the dependencie for module SDk there is No Project JDk. and when i click on new it is just JSDK, Intellij idea plugin SDK,Flex SDK,AIR SDK, Flexmojos SDk and Mobile SDK
What can I do?

Refer to the documentation. You need to add new JSDK with the following path:
/System/Library/Frameworks/JavaVM.Framework/Versions/CurrentJDK/Home

Agreed. Going one step further, I would recommend setting up the different sdk's explicitly for Java 5, 6, etc.
On OS 10.6, use:
/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home

Related

How to install SonarQube with Open JDK 11

I am trying to install SonarQube 8.5 (community version) on my local machine . My machine already has Java JRE 8 installed. SonaQube has pre-requirement JRE 11 or Open JDK 11. Since you cannot download JRE 11 anymore, I decided to go with Open JDK 11
I want to set SonarQube to use specific JDK. How do i do that?
Quick SO search suggest to use wrapper.java.command in wrapper.conf file, but this line is not available
SonarQube 8.5, OS Windows: 10
If you want your sonarqube to use specific JDK i.e. in your case OpenJDK 11, rather than use JRE 8. You can create a user say sonar.
Give sonar user the ownership of all the installations of sonarqube. Set the path of JAVA_HOME for OpenJDK11 for the usersonar only.
Note: You have to start sonarqube using sonar user only.
Then , you can set SonarQube to use specific JDK
According to sonarqube community, you should do the following:
Edit conf\wrapper.conf, specifically the wrapper.java.command to following:
wrapper.java.command=C:\Program Files\Java\open jdk-11.0.2\bin\java
#wrapper.java.command=java
actually i found it
These doesn't exist by default, so I need to add these two lines into wrapper.conf
wrapper.java.command=C:\SonarQube\openjdk-11.0.2-win64\jdk-11.0.2\bin
wrapper.java.command=C:\SonarQube\openjdk-11.0.2-win64\jdk-11.0.2\bin\Java
Your installation base path may be different. But bin and bin\Java is important

gradle-wrapper.properties not found after clean install intellij idea 2020.1.2 community edition on windows 10

Installed clean windows10(1607) and intellij idea(2020.1.2 community edition). When i create new gradle project
Invalid Gradle JDK configuration found. Open Gradle Settings
"gradle-wrapper.properties not found".
How can I fix it?
Install gradle 6.7
sdk install gradle 6.7
brew install gradle
Go to IntelliJ and set gradle version:
On File >> Settings >> Build, Execution , Deployment >> Gradle
or
Preferences >> Gradle
In Use Gradke from specific the correct location
If IDEA is set to use the Gradle wrapper (as it is in your screenshot: "Use Gradle from:" is set to "gradle-wrapper.properties"), IDEA expects the following file structure:
Gradle wrapper JAR: [project root]/gradle/wrapper/gradle-wrapper.jar
Gradle wrapper properties: [project root]/gradle/wrapper/gradle-wrapper.properties
Gradle wrapper script: [project root]/gradlew.bat
If you are missing one of these three elements, IDEA will attempt to generate the wrapper by calling the gradle wrapper task. It will do this using the Gradle JDK, which may or may not be the project SDK (File > Settings > Build, Execution, Deployment > Build Tools > Gradle > Gradle JVM).
I'm not sure how it selects the version of Gradle it uses - I only have 6.8.3 installed on my machine, and I had my wrapper properties set to 7.0-rc-1, yet somehow it used 6.7.0 when generating the wrapper.
I tried various options for clearing the cache, but did not get the result.
Openjdk-14 installed by default and does not work. From site adoptopenjdk.net install OpenJDK 11 (LTS). When creating the project, I chose 11 version. Then the program suggested updating gradle to version 6 and it worked.
I ran into this problem a while ago when I upgraded to intellij 2020.* The first time I created a new project there was no problem: gradle daemon did its work and the project was created with no problems.
In my case, the project would start a new gradle daemon, and attempt to build the project, would get rejected by windows Security, and nothing would happen, so intellij goes ahead and starts another (unsuccessful) daemon. Soon, I had 20+ gradle daemon processes running on my system, all of them doing nothing.
So, it looks like intellij has messed in enabling that it places the appropriate permissions it requires for these folders that it depends on to run properly. So, you need to manually give these permissions, and then things (should) work.
The real issue here is security on your machine: either a virus checker or the security software, Windows Security on Windows 10, for example. The first time you make a project, Intellij goes and produces a number of folders that they need access to.
However, once these folders are available, for whatever, intellij doesn't make sure to give itself access.
On windows 10, in AppData, you'll find several folders required by Intellij to produce, in my case, produce gradle projects.
Try finding the various folders that Intellij has produced on your system, and give them exceptions on your virus checker and on whatever firewall/security software programs that may block access.

Run Corda project on IntelliJ

I'm using a MacBook Air OS X 10.9 (Mavericks) and IntelliJ IDEA, but the IDE won't let me execute the test "ProjectImportedOKTest" which is in src/test/java/java_bootcamp/. I followed the exact same steps of this video:
https://www.youtube.com/watch?v=ZgKxjwImKAs&index=3&list=PLi1PppB3-YrVq5Qy_RM9Qidq0eh-nL11N
But for some reason my green arrow to run the test is always disabled. It could be something with the configuration option in the top left of IntelliJ, which I left blank or even something with gradle.
Thanks a lot!!
You can invalidate the caches of the intelliJ by using the option
file -> invalidate caches/Restart.
It helped for me.
There are several things you could try.
Ensure that your source java or kotlin folder is marked as "Sources Root". Do this by right clicking the folder and selecting "Mark Directory as"
Go to view -> Tool Windows -> Gradle and hit the refresh icon
Try opening the project a different way, such as importing the project or just opening the project
Rebuild the project and ensure there are no errors
Go to File -> Project Structure and ensure Java 1.8 is set as the Project SDK
Got to File -> Settings 0> Build, Execution, Deployment and select Gradle. Ensure Gradle JVM has Java 1.8 and that "Use default gradle wrapper" is selected.
Again under Settings and Build, Execution, Deployment, go to Compiler -> Kotlin Compiler and check that Target JVM version is set to 1.8
I ran into the same problem running on Windows and ran into this question trying to find the solution. It turns out Gradle wasn't installed on my machine and that was causing the problems.
According to the Corda Docs - "Gradle - we use 4.10 and the gradlew script in the project / samples directories will download it for you."
However, I installed from the Gradle website here - https://gradle.org/install/#with-a-package-manager -and configured it in the PATH variable. After doing so, my green arrow was enabled and I was able to run the test successfully.

IntelliJ Community 12 CE + JFlex

I'm following this tutorial to create a custom language plugin for IntelliJ 12, but I'm running into several issues in regards to the jFlex plugin.
When the plugin was installed (via IntelliJ plugin browser) it was configured with the following paths:
Flex: /Applications/IntelliJ IDEA 12 CE.app/tools/jflex
Flex Skeleton: /Applications/IntelliJ IDEA 12 CE.app/tools/jflex/idea-flex.skeleton
IntelliJ warned me it could not find the jFlex application, so I downloaded the latest zip package from jflex.de and extracted it. I updated the jFlex plugin configurations in IntelliJ and get a new error when I try to build: ./lib/jflex.jar is not configured on the path.
Flex: /Users/skyler/jflex-1.4.3/jflex-1.4.3/bin
Flex Skeleton: /Users/skyler/jflex-1.4.3/jflex-1.4.3/src/default.skeleton
I did confirm the jar exists in /Users/skyler/jflex-1.4.3/jflex-1.4.3/lib. Of course the path referenced in the error would not find the jar.
So here are my questions:
Where is the idea-flex.skeleton file located? I cannot find it.
Do I need to update the jflex executable so the paths are correct, or move the file, and will there be any problems using jflex for language plugin development with this change?
As it turns out IntelliJ was missing the tools directory when you use the Mac installer. To solve the problem I had to clone the git repository for IntelliJ community and copy the jflex folder and skeleton into the expected locations. This issue is tracked by JetBrains.
http://youtrack.jetbrains.com/issue/IDEA-110168

IntelliJ IDEA JDK configuration on Mac OS

I am using IntelliJ IDEA 10. Every time when I create a new project, it is asking me to choose JDK for this project. Anyone know how I can configure it and make it easy to use?
If you are on Mac OS X or Ubuntu, the problem is caused by the symlinks to the JDK. File | Invalidate Caches should help. If it doesn't, specify the JDK path to the direct JDK Home folder, not a symlink.
Invalidate Caches menu item is available under IntelliJ IDEA File menu.
Direct JDK path after the recent Apple Java update is:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
In IDEA you can configure the new JSDK in File | Project Structure, select SDKs on the left, then press [+] button, then specify the above JDK home path, you should get something like this:
Just tried this recently and when trying to select the JDK... /System/Library/Java/JavaVirtualMachines/ appears as empty when opening&selecting through IntelliJ. Therefore i couldn't select the JDK...
I've found that to workaround this, when the finder windows open (pressing [+] JDK) just use the shortcut Shift + CMD + G to specify the path. (/System/Library/Java/JavaVirtualMachines/1.6.0.jdk in my case)
And voila, IntelliJ can find everything from that point on.
The JDK path might change when you update JAVA. For Mac you should go to the following path to check the JAVA version installed.
/Library/Java/JavaVirtualMachines/
Next, say JDK version that you find is jdk1.8.0_151.jdk, the path to home directory within it is the JDK home path.
In my case it was :
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
You can configure it by going to File -> Project Structure -> SDKs.
On Mac IntelliJ Idea 12 has it's preferences/keymaps placed here:
./Users/viliuskraujutis/Library/Preferences/IdeaIC12/keymaps/

Resources