Java 10: The type java.lang.Object cannot be resolved
See original GitHub issueEnvironment
- 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
- 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 .
- Open a java file like
Bootstrap.java
to kick of the language service. - 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.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Java project in Eclipse: The type java.lang.Object cannot be ...
While we are working with tomcat 6 and jdk 1.8 versions, some of the features will not work and this error ...
Read more >"The type java.lang.Object cannot be resolved" when building ...
"The type java. lang. Object cannot be resolved" when building multithreaded with OpenJDK17 · Issue #1099 · eclipse-tycho/tycho · GitHub.
Read more >Java project in Eclipse: The type java.lang.Object ... - Intellipaat
1 Answer · Close the project and resume it. · Clean the project (It will restore the buildpath hence reconfiguring with the JDK...
Read more >'The type Java.lang.Object cannot be resolved. It is indirectly ...
You need to go to your Java preferences and make sure you have a valid JRE selected for your project (it could be...
Read more >The type java.lang.Object cannot be resolved. It is indirectly ...
Above error shows up when you do not have JRE or JDK not added to your build path. This is the well-known bug...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Works for me. Thanks for the quick response, @snjeza!
From @Snjeza it looks like has been fixed upstream so we’re just waiting in them to release and vscode-java to upgrade.
I’m stuck on Java 10 so this issue prevents me from using vscode-java. I admit I’m probably in the minority. We try to keep up with all the new Java releases to be good open source citizens but lots of projects don’t have time for that.
On Sat, Mar 31, 2018, 3:15 AM ChirayuShishodiya notifications@github.com wrote: