-
Notifications
You must be signed in to change notification settings - Fork 455
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
How can I set the Java runtime version to JDK 8 for a specific project? #1555
Comments
I guess you're not using any build tool. For the standalone Java files, the extension will use the language level from the default JDK runtime you configured in user setting. If you use maven or gradle, their build file such as pom.xml/build.gradle provides options to specify the complier version. |
So if I don't use a build tool I have to change the runtime in settings? |
yes, you can only change the global user setting for that. |
Thanks |
Would it be possible to make the |
@n-peugnet what sorts of projects are you using with vscode-java? |
@fbricon I would say any kind of project. For bigger projects and especially if I need to work with other people I usually setup Maven to have a common build system. But for smaller/school project I would love to be able to just make a folder and set all the build configuration in my For the current issue, I think that it would be sufficient to have a |
And to clarify my current use case, I am currently doing school projects using Hadoop. The latest stable version 3.2.1 does not support Java11 so I have to use an older version (1.8). I am using vscode to code and compile some MapReduce jobs but these have to be compiled with 1.8 for yarn to be able to run them. I use Java11 in almost every other projects so I would like not to have to switch the default version in my User settings each time I switch projects. Maven would be overkill and since I am already setting the Another solution would be to be able to set the |
[provide a description of the issue]
Environment
Steps To Reproduce
[Please attach a sample project reproducing the error]
Please attach logs
Current Result
Expected Result
Additional Informations
I was wondering if there was a way to make a single project run java programs using JDK 8. I have already put this specific JDK in java.configuration.runtimes but I am not seeing the status bar icon to change the Java Language Level. I have gotten it to work by setting default to true for the JDK I want to use in java.configuraiton.runtimes but I was wondering if there was a way to do this that didn't involve changing my settings for all projects.
The text was updated successfully, but these errors were encountered: