{"id":229885,"date":"2023-05-30T00:06:49","date_gmt":"2023-05-30T07:06:49","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/java\/?p=229885"},"modified":"2023-05-30T00:06:49","modified_gmt":"2023-05-30T07:06:49","slug":"java-on-visual-studio-code-may-2023","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/java\/java-on-visual-studio-code-may-2023\/","title":{"rendered":"Java on Visual Studio Code &#8211; May 2023"},"content":{"rendered":"<p>Hi everyone, welcome to our May update for Visual Studio Code Java! In this month&#8217;s blog, we have tons of new features covering performance improvement, user experience as well as Spring Boot integration, so let&#8217;s get started.<\/p>\n<h4><strong>Built-in Java Profile Templates in VS Code<\/strong><\/h4>\n<p><a href=\"https:\/\/code.visualstudio.com\/docs\/editor\/profiles\">Profiles<\/a> is a recent feature from VS Code that allows you to quickly switch your editor extensions, settings, and UI layout based on your current project or task. Starting in VS Code version 1.78, we have provided two built-in Java profile template for you to use. The two Java profiles are<\/p>\n<ul>\n<li>Java General &#8211; Provides a good starting point for all general Java work.<\/li>\n<li>Java Spring &#8211; Provides a good starting point for Spring developers<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"size-full\" src=\"https:\/\/code.visualstudio.com\/assets\/updates\/1_78\/profile-template-dropdown.png\" alt=\"Profile template dropdown\" width=\"730\" height=\"291\" \/><\/p>\n<p>Once you switch to these profiles, you can easily get started for your Java projects and customize the profiles further. Please let us know if these templates can be improved at <a href=\"https:\/\/github.com\/Microsoft\/vscode-java-pack\">https:\/\/github.com\/Microsoft\/vscode-java-pack. <\/a>For details for both profiles, please visit the <a href=\"https:\/\/code.visualstudio.com\/docs\/editor\/profiles#_java-general-profile-template\">official documentation<\/a> here.<\/p>\n<h4><strong>New Java Project Explorer UI Updates<\/strong><\/h4>\n<p>We introduced our new Java Project Explorer UI last month, and we have been making new improvements. Here&#8217;s the list of improvements we made<\/p>\n<ul>\n<li>A filter button that allows you to hide\/show non-Java resources<\/li>\n<li>Automatically hide files you configure from <strong>settings.json<\/strong><\/li>\n<li>Different right click action (New Java class, package, file) depending on the current context<\/li>\n<\/ul>\n<p>Here&#8217;s a demo that covers all the features above. Please let us know if you have any <a href=\"https:\/\/github.com\/Microsoft\/vscode-java-pack\">feedback<\/a> regarding these UI updates.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/05\/projectexplorer.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229920\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/05\/projectexplorer.gif\" alt=\"Java Project Explorer New UX\" width=\"1684\" height=\"1146\" \/><\/a><\/p>\n<h4><strong>Whitelist for exception types<\/strong><\/h4>\n<p>We have also added a debugging feature that allows you to specify a white list of exception types, so you can break on them without setting breakpoints, e.g. NullPointerException. This is a useful feature when you are expecting some kind of exception types or catching unexpected bugs.<\/p>\n<p>You can set these exception types using this setting: <strong><span style=\"font-size: 1rem; text-align: var(--bs-body-text-align);\">&#8220;java.debug.settings.exceptionBreakpoint.exceptionTypes&#8221;. <\/span><\/strong>Here&#8217;s a quick demo.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/05\/whitelist.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229922\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/05\/whitelist.gif\" alt=\"Excpetion Type\" width=\"2034\" height=\"1508\" \/><\/a><\/p>\n<h4><strong>Project import time improvement using Maven parallel download<\/strong><\/h4>\n<p>In addition to user experience improvements, we also made important performance improvements. Starting in version 1.17, we introduced parallel downloading for downloading Maven dependencies (Previously, all dependency downloading was serial). Since this change was added, we have noticed significant improvement time decrease for project import. We did some internal testing on fresh projects on Codespaces on Spring-petclinic project. Here&#8217;s the result.<\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 50%;\">Version<\/td>\n<td style=\"width: 50%;\">Time Cost (Average)<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">1.16<\/td>\n<td style=\"width: 50%;\">2 min 58s<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 50%;\">1.17<\/td>\n<td style=\"width: 50%;\">1 min 41s<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>The data shows project import time is indeed improved by the Maven parallel download mechanism and we hope you try out the extension as well.<\/p>\n<h4><strong>Run Spring applications using Spring profiles<\/strong><\/h4>\n<p>Lastly, we want to share an update for Spring Boot dashboard. Profiles are a core feature of the Spring framework \u2014 allowing us to map our beans to different profiles \u2014 for example, dev \/ test, or different data sources. In our latest release, we have supported starting a Spring Boot application with a selected Spring profile from the Spring Boot dashboard directly using the UI. The way to use this feature is to right click on a Spring application in the Apps panel and select &#8220;Run with Profile&#8221;. Here&#8217;s a demo.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/05\/springprofile.gif\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229926\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2023\/05\/springprofile.gif\" alt=\"Spring profile\" width=\"1260\" height=\"864\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h4><strong>Install Extension Pack for Java<\/strong><\/h4>\n<p>To use all features mentioned above, please download and install <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=vscjava.vscode-java-pack\">Extension Pack for Java<\/a> on Visual Studio Code.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229421\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png\" alt=\"Extension pack for Java\" width=\"1215\" height=\"238\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack.png 1215w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-300x59.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-1024x201.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/09\/javapack-768x150.png 768w\" sizes=\"(max-width: 1215px) 100vw, 1215px\" \/><\/a><\/p>\n<p>If you are a Spring developer working on a Spring Boot application, you can also download the <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=Pivotal.vscode-boot-dev-pack\">Spring Boot Extension Pack<\/a> for specialized Spring experience.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png\"><img decoding=\"async\" class=\"alignnone size-full wp-image-229533\" src=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png\" alt=\"Spring boot extension pack\" width=\"1221\" height=\"224\" srcset=\"https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring.png 1221w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-300x55.png 300w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-1024x188.png 1024w, https:\/\/devblogs.microsoft.com\/java\/wp-content\/uploads\/sites\/51\/2022\/10\/spring-768x141.png 768w\" sizes=\"(max-width: 1221px) 100vw, 1221px\" \/><\/a><\/p>\n<p><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Feedback and suggestions<\/span><\/strong><\/span><\/p>\n<p>As always, your feedback and suggestions are very important to us and will help shape our product in future. There are several ways to give us feedback<\/p>\n<ul>\n<li>Leave your comment on this blog post<\/li>\n<li><a href=\"https:\/\/github.com\/microsoft\/vscode-java-pack\/issues\/new\/choose\" target=\"_blank\" rel=\"noopener\">Open an issue<\/a>\u00a0on our GitHub Issues page<\/li>\n<li>Send an email to: vscjfeedback@microsoft.com<\/li>\n<\/ul>\n<h2 id=\"try-it-out\" class=\"x-hidden-focus\"><span style=\"font-size: 18pt;\"><strong><span class=\"x-hidden-focus\">Resources<\/span><\/strong><\/span><\/h2>\n<p>Here is a list of links that are helpful to learn Java on Visual Studio Code.<\/p>\n<ul>\n<li class=\"x-hidden-focus\">Learn more about\u00a0<a class=\"x-hidden-focus\" href=\"https:\/\/code.visualstudio.com\/docs\/languages\/java\" target=\"_blank\" rel=\"noopener noreferrer\">Java on Visual Studio Code<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone, welcome to our May update for Visual Studio Code Java! In this month&#8217;s blog, we have tons of new features covering performance improvement, user experience as well as Spring Boot integration, so let&#8217;s get started. Built-in Java Profile Templates in VS Code Profiles is a recent feature from VS Code that allows you [&hellip;]<\/p>\n","protected":false},"author":31999,"featured_media":229936,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[14,22,1,8,15],"tags":[],"class_list":["post-229885","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud","category-desktop","category-java","category-open-source","category-vscode"],"acf":[],"blog_post_summary":"<p>Hi everyone, welcome to our May update for Visual Studio Code Java! In this month&#8217;s blog, we have tons of new features covering performance improvement, user experience as well as Spring Boot integration, so let&#8217;s get started. Built-in Java Profile Templates in VS Code Profiles is a recent feature from VS Code that allows you [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/229885","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/users\/31999"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/comments?post=229885"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/posts\/229885\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media\/229936"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/media?parent=229885"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/categories?post=229885"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/java\/wp-json\/wp\/v2\/tags?post=229885"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}