-
Notifications
You must be signed in to change notification settings - Fork 124
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
Java "var cannot be resolved to a type" - JDK 13.0 #313
Comments
Thanks for reaching out. The Java 13 syntax needs to be enabled explicitly. If you are using Maven, please follow the instructions: |
@akaroml Hello. I'm not using Maven. I was just testing a simple Program in Java.
Variable Type inference was introduced a long time ago in Java. I'm not sure why these errors are flaring up now. Is there something setting we can change for non-maven simple java programs? Any setting in |
@akaroml
It looks like your team does not have much context regarding this bug. If possible, please assign this bug to the appropriate RedHat team since they maintain the "Language Support for Java" extension. Also, since this is a valid issue, please assign "Bug" label for greater visibility. |
I have assigned this bug to the RedHat team. Issue: redhat-developer/vscode-java#1288 Closing this issue here. |
Had same error. To avoid this error, the first thing when creating a Java Project, we need to choose the JRE option as 'Use an execution environment JRE' instead of choosing 'Use a project specific JRE'. |
Issue Type: Bug
VSCode Java extension seems to raise error while using
var
data type (type inference for local variables was introduced way back with Java 10). Running the project also seems to fail while usingvar
datatype.There's absolutely no problem with my Java environment. Compiling and running the same Java file using
javac
andjava
succeeds in command line. This works fine with IntelliJ IDEA as well.Is there some setting or configuration I need to change? Screenshot of Java runtime configuration page below:-
Java environment details:
Error
Configure java runtime - JDK 13
Extension version: 0.8.1
VS Code version: Code 1.42.1 (c47d83b293181d9be64f27ff093689e8e7aed054, 2020-02-11T14:45:59.656Z)
OS version: Windows_NT x64 10.0.18362
System Info
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off
surface_control: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: enabled_on
viz_hit_test_surface_layer: disabled_off
webgl: enabled
webgl2: enabled
The text was updated successfully, but these errors were encountered: