Skip to content

Java 10: The type java.lang.Object cannot be resolved #483

@nik9000

Description

@nik9000
Environment
  • Operating System:
$ uname -a
Linux localhost.localdomain 4.15.9-200.fc26.x86_64 #1 SMP Mon Mar 12 17:11:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • JDK version: openjdk version "10" 2018-03-20
  • Visual Studio Code version:
Version 1.21.1
Commit 79b44aa704ce542d8ca4a3cc44cfca566e7720f1
Date 2018-03-14T14:46:30.761Z
Shell 1.7.9
Renderer 58.0.3029.110
Node 7.9.0
Architecture x64
  • Java extension version: 021.0
Steps To Reproduce
  1. These:
wget https://download.java.net/java/GA/jdk10/10/binaries/openjdk-10_linux-x64_bin.tar.gz
tar xf openjdk-10_linux-x64_bin.tar.gz
pushd jdk-10
export JAVA_HOME=export JAVA_HOME=$(pwd)
popd
git clone git@github.com:elastic/elasticsearch.git
pushd elasticsearch
code .
  1. Open a java file like Bootstrap.java to kick of the language service.
  2. Mouse over /* on line 1. You get
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

I get a bunch of errors in the logs like:

message: Unbound classpath container: 'JRE System Library [JavaSE-1.8]' in project ':benchmarks';code: 963

And some around cycles but I don't think either of these are a problem here because when I restart with Java 9 like so:

echo Drop back to the last commit that supported java 9
git checkout eebda6974dea3445d5a4043a843d206046861470
export JAVA_HOME=/usr/java/jdk-9.0.4
rm -rf ~/.config/Code/User/workspaceStorage/*
code .

I once again get definitions for things like Object.

If I jump back to java 10 while still on the java 9 supporting commit and restart everything breaks again.

I haven't tested this outside of Elasticsearch because I don't have another project handy but I don't see any issues around Java 10 so I kind of expected it to just work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions