Path JRE on VSCode MacOS - java

What is the correct path of JRE8 that I put in sonarlint.ls.javaHome in VSCode in MacOS so that it works correctly?
I have tried this:
\\Library\\Internet Plug-Ins\\JavaAppletPlugin.plugin\\Contents\\Home\\bin
/Library/Internet\\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin/

Install JDK and set "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home" in VSCODE settings under sonarlint.ls.javaHome

Ok, I have the same issue and there is one important message: you must use JRE8 and not the newest version of JRE (e.g. JRE 10) for the plugin "SonarLint" (sonarsource.sonarlint-vscode). With JRE9 or newer it doesn't work!
This path worked for me:
"sonarlint.ls.javaHome": "/Library/Internet PlugIns/JavaAppletPlugin.plugin/Contents/Home"

Related

JDK version 1.8 in the system but JDK 11 on VScode

I have JDK11 and JADK8 both installed on my MacOS. I have changed the JDK default version to 1.8 to make sure GlassFish V5 can be run.
However, the change is not taken place at VSCode, and VSCode terminal keeps on showing JDK11 as JAVA version, which is preventing me from running GlassFish server though VSCode.
How can I fix this?
Thank you
Here you can choose wich version to install.
Edit : as mentionned here
VS Code does not have built-in support for Java projects. You need to install some Java extensions and configure them to specify the correct Java JDK version, which you can do by either setting the JAVA_HOME environment variable or by setting the java.home setting:
It depends on the value of JAVA_HOME environment variable. Check your JAVA_HOME path in the settings.json file.
If it shows Java11, set JAVA_HOME environment variable as per your requirement and restart VSCode. Check How to set JAVA_HOME in Mac permanently?.
Java extension needs jdk11 or recent version to support, so it's required to set jdk11 as java.home in vscode, but it's also achievable to specify other jdk version for project.
Open Command Palette and Search Java: Configure Java Runtime.
Choose JDK8 for Project JDKs.
Choose JDK11 or recent version as
Java Tooling Time.
Don't forget to reload window to make the change effective.
Detailed information please view official docs: Configure JDK

"Cannot run program "cmd"" java maven quote [duplicate]

I've a fresh install of netbean 11.1.
Now I'm trying to build a project but I get the following error output:
Cannot run program "cmd" (in directory "C:\projects\open"): Malformed
argument has embedded quote: "C:\Program
Files\NetBeans-11.1\netbeans\java\maven\bin\mvn.cmd"
cd C:\projects\open; "JAVA_HOME=C:\\Program Files\\Java\\jdk-11.0.5" cmd /c "\"\"C:\\Program Files\\NetBeans-11.1\\netbeans\\java\\maven\\bin\\mvn.cmd\" -DskipTests=true -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans-11.1\\netbeans\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 clean install\"" Cannot run program "cmd" (in directory "C:\projects\open"): Malformed argument has embedded quote: "C:\Program Files\NetBeans-11.1\netbeans\java\maven\bin\mvn.cmd" -DskipTests=true -Dmaven.ext.class.path="C:\Program Files\NetBeans-11.1\netbeans\java\maven-nblib\netbeans-eventspy.jar" -Dfile.encoding=UTF-8 clean install
I've build this project with netbeans 11.1 before but have a new pc.
and a fresh install, tho I'm sure there was no problem last time I tried to install everything.
Although this problem can be fixed by installing jdk1.8.0_221, but actually you don't need to downgrade your JDK. Just try these:
First exit netbeans IDE if it's open, then open netbeans configuration file from here: netbeans-Install-Dir/etc/netbeans.conf
(Note: for me netbeans-Install-Dir is C:\Program Files\NetBeans 8.2\etc)
Add the below arguments
-J-Djdk.lang.Process.allowAmbiguousCommands=true
to the beginning of the string that you find at this line:
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m ......."
Sample screenshot as shown below:
4. Save the change and start your netbeans IDE.
I have checked the release notes for JDK 13.0.1 at https://www.oracle.com/technetwork/java/javase/13-0-1-relnotes-5592797.html#JDK-8221858
This behavior is a regression from a security fix for JDK-8221858 (not public). Follow the link for a full description. The fix is part of JDK 8u231, JDk 11.0.5, 13.0.1 etc.
To resolve this problem, append -J-Djdk.lang.Process.allowAmbiguousCommands=true to netbeans_default_options in <netbeans-dir>\etc\netbeans.conf.
I had this error with adopt8-hotspot (AdoptOpenJDK-1.8.0_232-b09) and sbt-0.13.X for an old project.
Problem solved after setting the environment variable in windows via
set JAVA_TOOL_OPTIONS=-Djdk.lang.Process.allowAmbiguousCommands=true
Did you by any chance install the latest critical update for java? jdk 1.7_241? I installed that today and was having the exact same problem. I downgraded my jdk version and it solved it completely.
EDIT: Apologies, I noticed you're using netbeans 11.1 so you probably have a later java version, in any case, you could try downgrading your java version to a previous release if you happened to update it today as the other version might have the same problem.
At the time that I'm writing, I had only JDK13 installed only on my machine. After unzipped my netbeans I've got the same problem with the internal maven of my netbeans 11.1.
Apparently netbeans 11.1 does not work properly with the JDK13. I just installed the JDK 8 and the problem now is solved, without any additional configuration or parameter change.
Nontheless, since I need the JDK13, I have both installed but my netbeans.conf file is pointing to JDK8. Later, you can define the new Java platform in netbeans project configuration.
I hope this might help.
Cheers!
just add -J-Djdk.lang.Process.allowAmbiguousCommands=true to netbeans_default_options in netbeans.conf
It seems to happen with all recently released jdk version (11.0.5 and 13.0.1 at least), even with the latest Netbeans 11.2vc1 (and witnessed on NB 11.1 too).
Downgrade your jdk to 11.0.4 or 13.0.0. It fixed the issue for me
The problem also occurs in version jdk-8u231. Fixing installing jdk-8u221 version
Apache NetBeans 11.1 does indeed not support JDK 13, that's what the upcoming Apache NetBeans 11.2 is for -- latest beta: bit.ly/apache-netbeans-11-2-beta-3
I had the same problem with oracle jdk 13.0.1 and netbeans 11.1, but it worked for me with openjdk 13.0.1 (https://jdk.java.net/13/).

Failed to create JVM : error code -6 in android studio

i am using windows 8.1
here is the error
cmd seems to see the java -version but not my android studio.
here is my system variable
AndroidStudio is not asking for a JDK, but for a JRE. Try changing the JAVA_HOME to the JRE bundled in the JDK:
C:\Progra~1\Java\jdk1.8.0_131\jre
If above don't work, try with:
C:\Progra~1\Java\jdk1.8.0_131\jre\bin
If neither of them works, check if your JDK is a 64-bit one since the AndroidStudio is asking for a 64-bit java version.
EDITING:
Also try copying the content of C:\Progra~1\Java\jdk1.8.0_131\jre to C:\Program Files\Android\Android Studio\jre\jre because it seems that AndroidStudio is checking for java in that path.
Delete the studio64.exe.vmoptions under C:\Users...AndroidStudio3.2\config.
edit the project's gradle.properties and add:
org.gradle.java.home = C\:\\Program\ Files\\Java\\jdk1.8.0_131

facing error while installing google android studio, require jdk

Restarted the computer after JDK installation. Problem solved. thanks
I am trying to install Android Studio, it is require JDK version 1.7 or higher.
Downloaded this:
android-studio-bundle-135.1641136.exe
jdk-8u25-windows-i586.exe
Installed jdk first: C:\Program Files\Java\jdk1.8.0_25\bin\java.exe
Now installing android which asking for JDK, provided that jdk folder.
showing this problem:
any help?
:) advance thanks.
Desktop Computer with win7 32.
Did you try selecting the root folder and not the bin folder? That would be my guess. Hope this helps.
This is because you have downloaded wrong JDK. You need to download JDK for Oracle. Your downloaded JDK has no bin or java.exe file so it throws that error. So you need to download JDK 1.7or JDK 1.8 of Oracle. You can download JDK from here
https://jdk7.java.net/download.html
add new variable to your Environment variables :
computer properties -> advanced system settings -> (tab) advanced -> environment variables ->
(in system variable ) new : variable name = JAVA_HOME , variable value = jdk path
example: C:\Program Files\Java\jdk1.8.0_25
Do Not include \bin when you point to your JDK Location.
install jdk-8u25-windows-i586.exe
Close android-studio-bundle-135.1641136.exe
Reinstall android-studio-bundle-135.1641136.exe
Just -_-

IntelliJ Idea JDK path

I have ubuntu 14.04, Im trying to configure IntelliJ Idea with scala, but I have problem with JDK path.
This is my configuration:
What Im doing wrong?
Hmm I installed openjdk again as I saw some less files there.
apt-get install openjdk-7-jdk
and works fine ;)
Check that the given path is pointing to JDK, not only to JRE.

Categories

Resources