Skip to content

Latest commit

 

History

History
64 lines (55 loc) · 3.15 KB

CONTRIBUTING.md

File metadata and controls

64 lines (55 loc) · 3.15 KB

Contributing to Java Debugger

Build and Debug

Getting the source

This debugger is written in TypeScript, and it depends on a Java Debug Server written in Java.

  • Suggest to create a new folder first.
    mkdir javaDebugger
    cd javaDebugger
  • Check out source code for the extension.
    git clone https://github.com/Microsoft/vscode-java-debug.git
  • Check out source code for the debug server.
    git clone https://github.com/Microsoft/java-debug.git

Now the folder structure looks like following:

javaDebugger/
├── java-debug
└── vscode-java-debug

Prerequisites

Install all the dependencies using npm (supposed to be installed together with Node.JS).

cd vscode-java-debug
npm install

Build and Run

Build the Debug Server

For convenience, there is a build script buildJdtlsExt.js defined in scripts/build. It builds the Java Debug Server and then copies the .jar file into folder vscode-java-debug/server.

npm run build-server

NOTE: If you didn't follow the steps to check out vscode-java-debug and java-debug in the same folder, please specify a correct server_dir in your buildJdtlsExt.js.

Debug the Extension

Open folder vscode-java-debug in VS Code, or simply execute following commands if you have code in your system PATH.

cd vscode-java-debug
code .

Press F5 to start debugging the extension, it will create a new window as the extension host.

Debug the Debug Server

When you are debugging the extension, it is able to debug the Java process with local port 1044. To remote debug the server, you can attach a Java debugger to localhost:1044 using an IDE (Eclipse, IntelliJ IDEA, etc) or the Java Debugger for VS Code itself.

Since we have checked in a valid launch.json to the repository, it would be easy to use the Java Debugger for VS Code itself to debug the server.

  • Open folder java-debug in a new window in VS Code.
  • Press F5 to attach.

Pull Requests

Before we can accept a pull request from you, you'll need to sign a Contributor License Agreement (CLA). It is an automated process and you only need to do it once. To enable us to quickly review and accept your pull requests, always create one pull request per issue and link the issue in the pull request.