Vscode-java: Not found JDK8 in macOS Sierra

Created on 29 Dec 2016  Â·  4Comments  Â·  Source: redhat-developer/vscode-java

[provide a description of the issue]

Environment
  • Operating System: macOS Sierra
  • JDK version: 1.8
  • Visual Studio Code version: 1.8.1
  • Java extension version:
Steps To Reproduce

  1. brew install java8

  2. install : Language support for Java â„¢ for Visual Studio Code
    3.
    open java project

[attach a sample project reproducing the error]

error: Java 8 is required to run. Please download and install a JDK 8.

---->
system java version:
$ java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

bug

Most helpful comment

@ulongx, resolved the issue by running the following command to get my proper JDK installation directory:

$ /usr/libexec/java_home -V

Which for me returned:

Matching Java Virtual Machines (2): 1.8.0_112, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home 1.8.0_74, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

Setting my java.home in the Code Workspace Settings to /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home

All 4 comments

Same issue here, I've set JAVA_HOME, the java.home and keep getting the same error.

@ulongx, resolved the issue by running the following command to get my proper JDK installation directory:

$ /usr/libexec/java_home -V

Which for me returned:

Matching Java Virtual Machines (2): 1.8.0_112, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home 1.8.0_74, x86_64: "Java SE 8" /Library/Java/JavaVirtualMachines/jdk1.8.0_74.jdk/Contents/Home

Setting my java.home in the Code Workspace Settings to /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home

maybe related to #136

@JaBurd very thank you!! that's ok.

Was this page helpful?
0 / 5 - 0 ratings