vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Disable automatic addition of --enable-preview flag

Open jbhateja opened this issue 5 years ago • 4 comments

[provide a description of the issue]

Hi,

Usage of --enable-preview flag during compilation of stand along java file inhabits backward compatibility of generated class file.

It will be more useful if adding this option is left to the user instead of tool automatically adding it.

Thanks

Environment
  • Operating System: any
  • JDK version: 14
  • Visual Studio Code version:
  • Java extension version: .49
Steps To Reproduce
  1. Compile hello world using jdk 14
  2. Run generate class file in jdk 15

[Please attach a sample project reproducing the error] Please attach logs

Current Result
Expected Result
Additional Informations

jbhateja avatar Oct 31 '20 11:10 jbhateja

If you're referring to standalone java files, the generated .class is not exposed to users, so how do you run it?

fbricon avatar Nov 03 '20 09:11 fbricon

Maybe related to this issue, VS Code also has started littering our .settings/org.eclipse.jdt.core.prefs files with the following unwelcome addition:

org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=enabled
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore

VS Code adds these settings even if we set enablePreviewFeatures=disabled first. There appears to be no way to disable the preview features.

pcantrell avatar Aug 25 '21 21:08 pcantrell

So.. how exactly can it be disabled for single files?

awsms avatar Jan 31 '23 01:01 awsms

Same here ! I have to uncheck it everytime for my project to work.

jaysonsosweet avatar Sep 23 '24 16:09 jaysonsosweet