Help with a download i dont understand

Hi, this is Jack of FRC team 7479. We are having a little trouble with our VS Code and such. You see, our computer from last years competition died and can no longer be in use but we manage to save the code and all that was on the computer. We are now using a new computer and manage to get most of all of apps from the old computer to this new one EXCEPT, our VS Code Java installation. Everytime I go into VS Code it always comes up with this error saying that its missing some sort of Java installation. It keeps coming up with the following code everytime I try to deploy, build or debug the code

JAVA_HOME is set to an invalid directory: D:\Users\Public\frc2019\jdk

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation.
The terminal process terminated with exit code: 1

It asks me for a development kit and it sends me to RedHat where I have to download a zip. And im just really confused on this and I really need some help on where to put this file since we have a recovery file from the old computer. If anyone could help me with this, I’ll be forever in your debt.

And I have no idea on how to change this JAVA_HOME issue too and I think that might be the main problem, and if there is anything I need to download, I have no idea where the file goes or anything, so if anyone could give me guidance, that would be greatly appreciative.

1 Like

As you’ve discovered, you have to have a JDK installed on your device to code in Java. So if you open the zip it will walk you through the installation process. When you install the JDK it should automatically create the \jdk folder.

But now ive done that and i dont know where to put this file, it keeps coming up with this enviorment code and we cant build deploy or save any changes we’ve made in VS Code. idk what to do

The one thing that you could do but isn’t fast. Delete everything you downloaded and redownload again.

Mostly unrelated to your problem, but I would highly recommending using source code management, such as GitHub, for future seasons. It’ll mean you don’t have to rely on having a single working copy of code on a single computer, and if you have a situation like this again you’ll be able to restore the backup of the code from GitHub. Additionally, you can have multiple people working together from their own laptops.

As for the JAVA_HOME issue, you should be able to download Java 11 from the Oracle website, and the installer will set JAVA_HOME to the correct location. https://www.oracle.com/technetwork/java/javase/downloads/jdk11-downloads-5066655.html

1 Like

Did you follow the installation instructions regarding use of the offline installer for WPILib? The offline installer takes care of installing the JDK in the correct location, and also installs VS Code with the correct plugins and settings for use with robot programs.

Do not try to install Java 11 (e.g. by downloading from Oracle) or VSCode (e.g. by downloading from Microsoft) yourself, the installer takes care of installing both of these for you if you follow the installation instructions.

1 Like

I’ve done that but the JAVA_HOME thing still going on, I downloaded literally everything Java related, now everything is erroring when everything was working fine, I absolutely have no idea whats going on or what happened or what I did. Should I just import this code on github and see if it errors out for anyone? I’m not sure what to do at this point.

Nothing has changed, this JAVA_HOME Error keeps popping up, and when we started last year, we let the installer do the work. Should we just download VS Code again from the origin? I’m all out of ideas

Every once in a while my JAVA_HOME environment variable does not get set by the installer.

Type ‘environment’ into windows search box and you should get a ‘Edit the system environment variable’ item. Click on that. The System Properties window will come up. Click on ‘Environment Variable…’ and you should see the Environment Variable screen. If there is a JAVA_HOME entry change it to the JDK. My JDK is at C:\Program Files\Java\jdk-11.0.3 .

If the JAVA_HOME is not there click ‘New…’ and add it.

-Jim

1 Like

In settings.json in the .vscode folder, your project doesn’t happen to have a java.home variable set, right? If so remove it and then restart.

but now its coming up with this error

  • What went wrong:
    A problem occurred configuring root project ‘FRC Coding’.

Could not resolve all artifacts for configuration ‘:classpath’.
Could not resolve com.google.code.gson:gson:2.2.4.
Required by:
project : > edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2019.4.1 > edu.wpi.first:GradleRIO:2019.4.1
project : > edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2019.4.1 > edu.wpi.first:GradleRIO:2019.4.1 > edu.wpi.first:gradle-cpp-vscode:0.7.1
Could not resolve com.google.code.gson:gson:2.2.4.
Could not get resource ‘https://plugins.gradle.org/m2/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom’.
Could not GET ‘https://jcenter.bintray.com/com/google/code/gson/gson/2.2.4/gson-2.2.4.pom’.
Connection reset
Could not resolve com.jcraft:jsch:0.1.53.
Required by:
project : > edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2019.4.1 > edu.wpi.first:GradleRIO:2019.4.1
project : > edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2019.4.1 > edu.wpi.first:GradleRIO:2019.4.1 > edu.wpi.first:ToolchainPlugin:2019.4.1 > jaci.gradle:EmbeddedTools:2018.12.18
Could not resolve com.jcraft:jsch:0.1.53.
Could not get resource ‘https://plugins.gradle.org/m2/com/jcraft/jsch/0.1.53/jsch-0.1.53.pom’.
Could not GET ‘https://jcenter.bintray.com/com/jcraft/jsch/0.1.53/jsch-0.1.53.pom’.
Connection reset
Could not resolve org.apache.httpcomponents:httpclient:4.5.2.
Required by:
project : > edu.wpi.first.GradleRIO:edu.wpi.first.GradleRIO.gradle.plugin:2019.4.1 > edu.wpi.first:GradleRIO:2019.4.1 > edu.wpi.first:ToolchainPlugin:2019.4.1 > de.undercouch:gradle-download-task:3.1.2
Could not resolve org.apache.httpcomponents:httpclient:4.5.2.
Could not get resource ‘https://plugins.gradle.org/m2/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.pom’.
Could not GET ‘https://jcenter.bintray.com/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.pom’.
Connection reset

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 36s
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

Ive already tried uninstalling everything and reinstalling everything. Didnt work, ive tried installing new files into vscode, and i dont know if im putting them in the right place. I have no idea whats going on

Have you made sure to install and update your FRC plug-ins?

It can be frustrating and demoralizing to run into these issues - it’s great that you are asking for help! Hopefully once you get it set up it should be smooth sailing until you forget a semi-colon :wink:

how do i update the plugins?

Sorry - I don’t think update is a thing anymore, my brain is still calibrated to a different tool from a couple years ago.

If you’re using Java (which it sounds like) then I can recommend going through the resources found here:
https://wpilib.screenstepslive.com/s/currentCS/m/java

That site will be taken down in a few weeks. The new official site is https://docs.wpilib.org/en/latest/

3 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.