You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/java/extensions.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,9 +19,12 @@ To help set up Java on VS Code, there is a [Java Extension Pack](https://marketp
19
19
20
20
1.[Language Support for Java(TM) by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java)
21
21
2.[Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug)
22
+
3.[Java Test Runner](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test)
22
23
23
24
<aclass="tutorial-install-extension-btn"href="vscode:extension/vscjava.vscode-java-pack">Install the Java Extension Pack</a>
24
25
26
+
In case you're working on Spring Boot, there's also a [Spring Boot Development Extension Pack](https://marketplace.visualstudio.com/items?itemName=Pivotal.vscode-boot-dev-pack) developed by Pivotal.
27
+
25
28
## Recommended extensions for cloud (Azure) development
26
29
27
30
Along with the language support, if you are deploying your applications to the cloud, especially Azure, there is a [Azure Extension Pack](https://marketplace.visualstudio.com/items?itemName=ms-vscode.vscode-azureextensionpack) which contains extensions for popular Azure Services:
Copy file name to clipboardExpand all lines: docs/java/java-debugging.md
+35-8Lines changed: 35 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
---
2
2
Order: 5
3
3
Area: java
4
-
TOCTitle: Debugging
4
+
TOCTitle: Debugging and Testing
5
5
ContentId: 929e5410-3bfe-4107-b331-565afe5d341f
6
-
PageTitle: Debugging Java in VS Code
6
+
PageTitle: Debugging and Testing Java in VS Code
7
7
DateApproved: 11/14/2017
8
-
MetaDescription: See how you can debug your Java code locally, and in the cloud.
8
+
MetaDescription: See how you can debug and test your Java code locally, and in the cloud.
9
9
MetaSocialImage:
10
10
---
11
11
# Debugging Java in VS Code
@@ -30,12 +30,14 @@ Here's a list of supported debugging features:
30
30
31
31
Just like VS Code, the debugger is an open source project which welcomes contributors to collaborate with us through our GitHub repositories:
32
32
33
-
[Debugger for Java Extension](https://github.com/Microsoft/vscode-java-debug)
34
-
[Java Debugger Server for Visual Studio Code](https://github.com/Microsoft/java-debug)
33
+
-[Debugger for Java Extension](https://github.com/Microsoft/vscode-java-debug)
34
+
-[Java Debugger Server for Visual Studio Code](https://github.com/Microsoft/java-debug)
35
+
36
+
To run and debug JUnit test, you can install [Java Test Runner](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test), which is another lightweight extension we developed. You can also view test log from the extension.
35
37
36
38
## Install
37
39
38
-
For the debugger to work, you also need to have the [Language Support for Java(TM) by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) with your VS Code installed. To make it easier, we provide a [Java Extension Pack](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) which bundles both the [Language Support for Java(TM) by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) and the [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug).
40
+
For the debugger to work, you also need to have the [Language Support for Java(TM) by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) with your VS Code installed. To make it easier, we provide a [Java Extension Pack](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack) which bundles the [Language Support for Java(TM) by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java), the [Debugger for Java](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-debug) as well as the [Java Test Runner](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test).
39
41
40
42
The first time you edit a Java file, you will be prompted to install the extension pack. You can also install it manually from the Extension view (`kb(workbench.view.extensions)`). In the Extension view search box, type `vscode-java-pack`.
41
43
@@ -63,21 +65,37 @@ Even if there's just a single Java file without any project, you can use VS Code
63
65
64
66
The Java debugger also supports external source files. This lets you debug third party classes when they are inside a JAR or a source attachment. Just set your breakpoints in those classes before you start debugging. Java 9 is supported with VS Code as well.
The default Debug Console in VS Code doesn't support inputs. In case your program need inputs from terminal, you can use integrated terminal within VS Code or external terminal to launch it.
71
+
72
+

73
+
74
+
There're a lot of different [options and settings](#_options) available with this Debugger. For example, configuring cwd and environment variables could be easily done with launch options.
Please also check the documentation of [Language Support for Java by Red Hat](https://marketplace.visualstudio.com/items?itemName=redhat.java) if you have trouble setting up your project.
67
79
68
80
## Options
69
81
70
82
### Launch
71
83
72
-
-`mainClass` (required) - The main class of the program (fully qualified name, for example `com.xyz.MainClass`).
84
+
-`mainClass` (required) - The main class of the program (fully qualified name, e.g. [mymodule/]com.xyz.MainClass).
73
85
-`args` - The command line arguments passed to the program.
74
86
-`sourcePaths` - The extra source directories of the program. The debugger looks for source code from project settings by default. This option allows the debugger to look for source code in extra directories.
87
+
-`modulePaths` - The modulepaths for launching the JVM. If not specified, the debugger will automatically resolve from current project.
75
88
-`classPaths` - The classpaths for launching the JVM. If not specified, the debugger will automatically resolve from current project.
76
-
-`encoding` - The `file.encoding` setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in [Supported Encodings](http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html).
89
+
-`encoding` - The `file.encoding` setting for the JVM. If not specified, 'UTF-8' will be used. Possible values can be found in http://docs.oracle.com/javase/8/docs/technotes/guides/intl/encoding.doc.html.
77
90
-`vmArgs` - The extra options and system properties for the JVM (e.g. -Xms\<size\> -Xmx\<size\> -D\<name\>=\<value\>).
78
91
-`projectName` - The preferred project in which the debugger searches for classes. There could be duplicated class names in different projects. This setting also works when the debugger looks for the specified main class when launching a program.
79
92
-`cwd` - The working directory of the program.
80
93
-`env` - The extra environment variables for the program.
94
+
-`stopOnEntry` - Automatically pause the program after launching.
95
+
-`console` - The specified console to launch the program. Defaults to `internalConsole`.
96
+
-`internalConsole` - VS Code debug console (input stream not supported).
97
+
-`integratedTerminal` - VS Code integrated terminal.
98
+
-`externalTerminal` - External terminal that can be configured in user settings.
81
99
82
100
### Attach
83
101
@@ -90,11 +108,20 @@ Please also check the documentation of [Language Support for Java by Red Hat](ht
90
108
### User Settings
91
109
92
110
-`java.debug.logLevel`: minimum level of debugger logs that are sent to VS Code, defaults to `warn`.
111
+
-`java.debug.settings.showHex`: show numbers in hex format in "Variables" viewlet, defaults to `false`.
112
+
-`java.debug.settings.showStaticVariables`: show static variables in "Variables" viewlet, defaults to `true`.
113
+
-`java.debug.settings.showQualifiedNames`: show fully qualified class names in "Variables" viewlet, defaults to `false`.
114
+
-`java.debug.settings.maxStringLength`: the maximum length of string displayed in "Variables" or "Debug Console" viewlet, the string longer than this length will be trimmed, defaults to `0` which means no trim is performed.
93
115
94
116
## Feedback and Questions
95
117
96
118
You can find the full list of issues at [Issue Tracker](https://github.com/Microsoft/vscode-java-debug/issues). You can submit a [bug or feature suggestion](https://github.com/Microsoft/vscode-java-debug/issues/new), and participate in the community driven [Gitter](https://gitter.im/Microsoft/vscode-java-debug) channel.
97
119
120
+
## Run JUnit Tests
121
+
[Java Test Runner](https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test) allows you to run and debug your test cases.
0 commit comments