Search code examples
javavisual-studio-codecompilation

Passing argument to Java compiler in vscode


I have vscode 1.63.2, and working on a simple Java project (with no build tools). I'm using the recommended Java extensions pack. I can compile and run the project through vscode with no issues, but I can't find a way to pass a single argument to the command used to compile the .java files in settings. The command I want to pass is -release 9. Your help will be really appreciated.


Solution

  • I hope this could help: https://code.visualstudio.com/docs/java/java-debugging#_launch. See the Configuration Options section (the Launch paragraph). It seems like some options allow you to pass arguments to the JVM. However, you have to configure some JSON files.