-
Notifications
You must be signed in to change notification settings - Fork 406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Do I need the JavaRuntime to work with this tool? #100
Comments
Yes, you do. Specifically Java 8. I just noticed that we don't call this out specifically in the README. We should mention that. I'll mention describe the reason: The code smartness in Apex is powered by our new Apex compiler which is written in Java. Hence, you need Java to be able to run this. |
Thanks for the reply. Where and how should I set this up? |
@abhidotnet - Please check my video on youtube.. how to setup vscode for auto completion. It covers step to setup java. @vazexqi - I do not want to promote my video here .. please feel free to delete my comment if it is not appropriate... I just want to help people and want maximum people to use this tool. Thank you for your video.. My video was based on your's. |
@ruthemmanuelle - Do we have any instructions for setting up Java for the VS Code extension? I assume that it would be the same as it has been for the Eclipse IDE? Also, should this be added to the Troubleshooting guide? |
@vazexqi - Maybe we can add the info that Java is a prerequisite to the "Get Started with Salesforce Development Tools for Visual Studio Code" section here? https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode Here's what we say about Java for Force.com IDE 2 (https://developer.salesforce.com/docs/atlas.en-us.sfdx_ide2.meta/sfdx_ide2/sfdx_ide2_get_started_prerequisites.htm): Would the same info apply here, or do Salesforce Development Tools for Visual Studio Code users not need the full JDK? Adding something to the Troubleshooting guide as well as to the doc I linked to sounds good to me. |
@ruthemmanuelle - Let's continue to use the JDK. The JRE might be sufficient but in all our local and test environments, we are using the JDK so let's just keep it consistent that way.
|
How would I setup the path on windows? I have the jre for java 8 installed and the standard path |
@abhidotnet - /Program Files/Java/jre1.8.0_144. This works for me. |
I'm closing this since this is not an issue with our extension. There are enough resources on how to install Java on a machine. |
How to configure the location of the Java Runtime: |
I placed the following entry in my user settings file. |
@abhidotnet Does it work for you? Please not that Java 9 is not tested at this time and may not work. You should use Java 8. See #139. |
OS: Windows 10 I was using VS Code for a couple of weeks without the java error message then after an update of the Salesforce DX Extension in VS Code started getting the java error message. I fixed the problem when I added the following to User Settings in VS Code. "salesforcedx-vscode-apex.java.home": "C:\Program Files\Java\jre1.8.0_151", |
Seriously, just follow the basics. Have the JAVA_HOME env in your pc/mac ! |
I am running Ubuntu. My JDK is working (I got it with "apt-get install default-jdk"). I didn't have to do anything with JAVA_HOME to get it working. I install vscode with "dpkg", point it to some java, and click the "get Java Extension Pack" as suggested by vscode. And I get "Error: Java runtime could not be located."
|
But the vscode seems to find only via the JAVA_HOME, if I remember
correctly
On Mon, Jan 8, 2018 at 1:56 PM guify ***@***.***> wrote:
I am running Ubuntu. My JDK is working (I got it with "apt-get install
default-jdk"). I didn't have to do anything with JAVA_HOME to get it
working.
I install vscode with "dpkg", point it to some java, and click the "get
Java Extension Pack" as suggested by vscode.
And I get "Error: Java runtime could not be located."
Which is just so mysterious because I don't have any trouble locating it
myself.
max% java -version
java version "1.7.0_151"
OpenJDK Runtime Environment (IcedTea 2.6.11) (7u151-2.6.11-0ubuntu1.14.04.1)
OpenJDK 64-Bit Server VM (build 24.151-b01, mixed mode)
max%
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#100 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJme_74baixGiZ7wcxcdbXOzP3xUIqlRks5tInLugaJpZM4PQFdD>
.
--
Sent from mobile device, excuse typos if any.
|
@torynet - Your JDK_HOME is set wrongly. If you set both JAVA_HOME and JDK_HOME, we first try to read the entry of JDK_HOME and no longer try JAVA_HOME. See https://github.com/forcedotcom/salesforcedx-vscode/blob/develop/packages/salesforcedx-vscode-apex/src/requirements.ts#L46 Here is what mine looks like: Of course, yours would need to change yours to match your installation. Let me know if that still doesn't work. |
@vazexqi - First of all, thanks for the help. This seems so simple and yet I continue to struggle. When I looked up settings for these environment variables, I read that a good practice was to set one and then just refer to it from the others, but even when they are all set directly, nothing changes for me. |
Actually, isn't the VSC user setting supposed to override all of that anyway? |
And therein lies the problem. Got it. I swear I had tried that set to the base directory and not bin previously, but it seems to solve the problem, so I guess not. Thanks again. |
Summary
Getting this message
"Java runtime could not be located. Set one using the salesforcedx-vscode-apex.java.home VS Code setting"
Steps To Reproduce:
Open visual studio code with the extension enabled
VS Code Version:
1.15.1
SFDX CLI Version:
v40.0
OS and version:
Windows 10 64 bit.
The text was updated successfully, but these errors were encountered: