Run and Debug Java 9 in Visual Studio Code

In the past 3 weeks, we’ve continued to see a lot of people installing and trying our tools, reading our documents, and visiting our repository. We’ve also seen a number of new issues opened by the Java community. Thank you all for trying our tools and providing feedback, all of which is motivating us to make VS Code a better tool for Java developer. With our new 0.3.0 release, we have added a few new capabilities and addressed your top feedback.

Java 9 Support

Java 9 was officially out just weeks after the initial release of our debugger. To allow more and more developers to try the new version of Java with VS Code, we’ve also updated the debugger to automatically detect modular project and then resolve module path as well as main class accordingly. You can now launch your Java 9 application with breakpoint in your source file with VS Code.

No Project? No Problem!

Even if you just have a single Java file which is not part of any project, now you can also run and debug it with VS Code. We believe it will come in handy when you are just learning Java or writing some quick utility tools.

Configuring Workspace Folder and Environment Variables

Now you can also easily configure your workspace and set environment variables for your debuggee program easily in launch.json file.

For other changes and bug fixes, you can find more details in our changelog.

Looking forward

As you can see from the issue list from our open sourced GitHub repository, we’re actively working on several key new features which will be available in follow up releases. Those features include Junit test cases support, multi-root workspace support, expression evaluation as well as hot code replacing. Please don’t hesitate if you would like to share your thoughts with us, just join the Gitter discussion or submit an issue!

Try it out

If you’re trying to find a performant editor for your Java project, please give it a try

Xiaokai is a program manager working on Java tools and services. He’s currently focusing on making Visual Studio Code great for Java developers, as well as supporting Java in various of Azure services.

Tags

Sure, we’d like to do some recording if they are helpful. Could you please let us know what kind of tutorials you’re looking for? For now, you can find some more detailed tutorials at https://code.visualstudio.com/docs/java.

1 year ago

Gijs van Dam

I correct in assuming that the VSC Java debugger only supports debugging source code without a project with JDK9? I’m trying to set this up with JDK8, but failed to do so.