Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions com.microsoft.java.debug.core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,6 @@
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down Expand Up @@ -85,4 +78,21 @@
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>default-tools.jar</id>
<activation>
<jdk>(,9)</jdk>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9 is not official supported by Oracle. Just start with 10 is okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It represents the range < 9

</activation>
<dependencies>
<dependency>
<groupId>com.sun</groupId>
<artifactId>tools</artifactId>
<version>1.8</version>
<scope>system</scope>
<systemPath>${java.home}/../lib/tools.jar</systemPath>
</dependency>
</dependencies>
</profile>
</profiles>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,18 @@ public static IDebugSession launch(VirtualMachineManager vmManager,
List<LaunchingConnector> connectors = vmManager.launchingConnectors();
LaunchingConnector connector = connectors.get(0);

/** In the sun JDK 10, the first launching connector is com.sun.tools.jdi.RawCommandLineLauncher, which is not the one we want to use.
* Add the logic to filter the right one from LaunchingConnector list.
* This fix is only for the JDI implementation by JDK. Other JDI implementations (such as JDT) doesn't have the impact.
*/
final String SUN_LAUNCHING_CONNECTOR = "com.sun.tools.jdi.SunCommandLineLauncher";
for (LaunchingConnector con : connectors) {
if (con.getClass().getName().equals(SUN_LAUNCHING_CONNECTOR)) {
connector = con;
break;
}
}

Map<String, Argument> arguments = connector.defaultArguments();
arguments.get(SUSPEND).setValue("true");

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<properties>
<base.name>Java Debug Server for Visual Studio Code</base.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<tycho-version>1.0.0</tycho-version>
<tycho-version>1.1.0</tycho-version>
</properties>

<licenses>
Expand Down