question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Java runtime (JDK, not JRE) could not be located - but it is installed with sdkman

See original GitHub issue

I am using sdkman to manage my sdk’s including java

The extension does not seem to acknowledge my java sdk, even though the sdk should be present

`sdk current java Using java version 8.0.212-zulu

echo $JAVA_HOME /home/USER/.sdkman/candidates/java/current

ls /home/USER/.sdkman/candidates/java/current ASSEMBLY_EXCEPTION DISCLAIMER LICENSE sample bin include man src.zip CLASSPATH_EXCEPTION_NOTE jre readme.txt THIRD_PARTY_README demo lib release Welcome.html `

What does it look for?

Environment
  • Operating System: Ubuntu 19.04
  • JDK version: 8.0.212
  • Visual Studio Code version: 1.36.1
  • Java extension version: 0.47.0
Steps To Reproduce
  1. [step 1] Install jdk using sdkman
  2. [step 2] Install extension

[attach a sample project reproducing the error] attach logs

Current Result
Expected Result
Additional Informations

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

21reactions
fbriconcommented, Aug 1, 2019

try to set “java.home”:“/home/USER/.sdkman/candidates/java/current” in vscode’s settings.json

2reactions
tonymcneilcommented, May 18, 2022

For anybody else at the time of writing I’ve noticed that “java.home” has a comment in the default settings saying: // This setting is deprecated, please use 'java.jdt.ls.java.home' instead.

So I set it as follows in settings.json and it seemed to work (using ~ is better as this should work for linux and mac):

"java.jdt.ls.java.home": "~/.sdkman/candidates/java/current",

I had no luck is trying to use java.configuration.runtimes 😦

I’m using VSCode version:

Version: 1.67.1 (Universal)
Commit: da15b6fd3ef856477bf6f4fb29ba1b7af717770d
Date: 2022-05-06T12:37:16.526Z
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin arm64 21.5.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Eclipse can't find jdk installed with sdkman - Stack Overflow
The problem is that after I downloaded Eclipse and tried to run it, it just simply can't find the JDK. I have already...
Read more >
Usage - SDKMAN! the Software Development Kit Manager
Install the latest stable version of your SDK of choice (say, Java JDK) by running the following command: $ sdk install java. You...
Read more >
JDKs installed with SDKMAN are not selectable in the IDE
Install one or more JDK using sdkman eg.: sdk install java 8.0. · Open a project in IntelliJ IDEA · Navigate to the...
Read more >
How to Manage Your JDKs With SDKMAN
In this blog, you will learn how to manage several Java Development Kits (JDKs) on your Linux system using SDKMAN.
Read more >
Java Runtime not found | Apple Developer Forums
When you install Java (JRE) and try build your app, the build now finds Javas JRE which has everything it is needs to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found