You need to sign in to do that
Don't have an account?
Josip Juric87
VS Code with SFDX - ERROR: Java 8 is required to run
After installing VS Code and adding the Salesforce extensions, I get the error: "Java 8 is required to run. Download and install it from https://java.com/en/download/.", although I have Java 9 running. What can I do to fix that?
Sorry for this issue you are encountering.
May I suggest you please check with the prerequisites below.
Prerequisites
- Before you set up this extension, make sure that you have these essentials.
- Java 8 Platform, Standard Edition Development Kit
- Some features in Salesforce Extensions for VS Code depend upon the Java 8 Platform, Standard Edition Development Kit (JDK).
- If you don’t already have the JDK installed, install the latest version of the Java 8 JDK from Java SE Development Kit 8 Downloads.
- Visual Studio Code v1.17 or later
- Salesforce Extensions for VS Code
- Code smartness for sObjects in Apex code is powered by the salesforcedx-vscode-core extension. We suggest that you install all extensions in the salesforcedx-vscode extension pack.
- Its a must that you need to have Java8 platform for this
For more information please check with below link which might help you further.- https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-apex (https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-apex )
Please let us know if this helps.Thanks,
Nagendra
1) Download and install Java version 8 from https://java.com/en/download/mac_download.jsp.
2) In the OS terminal, enter command /usr/libexec/java_home -verbose
3) In the output, take note of the version number for Java 8, e.g. 1.8.0_191
4) In the OS terminal, enter command
export JAVA_HOME=`/usr/libexec/java_home -v <version>`
e.g. export JAVA_HOME=`/usr/libexec/java_home -v 1.8.0_191`
To use the other version of Java, repeat steps 2 to 4 with that version.
Well, this is my first post and the following link worked for me to resolve the JAVA required to issue(even though I had java 8 installed).
https://forcedotcom.github.io/salesforcedx-vscode/articles/getting-started/java-setup
AdoptOpenJDK
AdoptOpenJDK provides prebuilt OpenJDK binaries for free without authentication or complications.
Navigate to AdoptOpenJDK
Select OpenJDK 11 (LTS)
Select HotSpot
Click the Latest Release button to download.
Once the file is downloaded open it and complete the installation steps.
TellDunkin (https://www.telldunkin.me/)
I had this same problem. It took a while to get a solution.
This is how I finally resolved the problem for Windows.
I had multiple version of java installed. I uninstalled them all. Restart the PC.
Visit https://www.oracle.com/uk/java/technologies/javase/jdk11-archive-downloads.html and download the most recent version of Java 11
Get your java filepath. Mine looks like this C:\Program Files\Java\jdk-11.0.14. you only need to go as far as the Jdk-verion folder.
Go to Control Panel and search Environment Variables. Click on Edit the Sytem Environment variables > Environment Variables
In the System variables list. Make sure the JAVA_HOME is the same path ie C:\Program Files\Java\jdk-11.0.14. Click OK.
Now go to VS Code. File>Preferences>Settings ===> Seach apex. Paste the same path "C:\Program Files\Java\jdk-11.0.14" into "Salesforcedx-vscode-apex › Java: Home" text box field.
Restart Vs Code.
I hope this works for you too