Skip to content
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

VS Code Set up for FRC can't compile java #55784

Closed
BaconBuilders opened this issue Aug 3, 2018 · 3 comments
Closed

VS Code Set up for FRC can't compile java #55784

BaconBuilders opened this issue Aug 3, 2018 · 3 comments
Assignees
Labels
tasks Task system issues

Comments

@BaconBuilders
Copy link

  • VSCode Version: 1.25
  • OS Version: Fedora 28
    -Extensions: Java Extension Pack, WPILib Extension

Steps to Reproduce:

  1. Build Robot Project-- project compiles properly on same machine in Eclipse

When you attempt to build in VS Code you get the below error

Task :compileJava FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':compileJava'.

Could not find tools.jar. Please check that /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.181-7.b13.fc28.x86_64/jre contains a valid JDK installation.

  • 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 10s
1 actionable task: 1 executed
The terminal process terminated with exit code: 1

java.home has been set to the correct path, and we know JDK works because Eclipse builds with no issues on that path.

@vscodebot vscodebot bot added the tasks Task system issues label Aug 3, 2018
@ThadHouse
Copy link

This is not an issue in VS Code. However, as the developer of the WPILib extension, your issue is that you might be setting your java.home variable in VS Code, however that variable does not affect the build. You actually need to have your JAVA_HOME in the environment set to a JDK. It looks like yours is set to a JRE.

If switching your JAVA_HOME environment variable doesn't fix it, please create an issue in the GradleRIO issue over in WPILib. https://github.com/wpilibsuite/GradleRIO

@BaconBuilders
Copy link
Author

Thank you. A few hours after posting I was able to set the JAVA_HOME path and then point VScode in settings to the same. This appears to have corrected the problem. I am still not certain why VScode was looking in the wrong location. (Eclipse had no issues locating the JDK when it was installed.

This issue can be closed. Thank you for your assistance.

@dbaeumer
Copy link
Member

Great to hear that you were able to address this. Closing the issue according to the last comment.

@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tasks Task system issues
Projects
None yet
Development

No branches or pull requests

3 participants