Skip to content

Latest commit

 

History

History
68 lines (36 loc) · 4.62 KB

BUILDING.md

File metadata and controls

68 lines (36 loc) · 4.62 KB

Building

Prerequisites

JavaSE-11, Maven, and Eclipse (Eclipse IDE for Enterprise Java and Web Developers is recommended) are required to build the lsp4jakarta project.

Ensure the Eclipse Plug-in Development Environment (PDE) is installed in your Eclipse workspace.

Setup instructions

The following are instructions to set up your Eclipse workspace

  1. Clone this repository onto your local machine

    git clone https://github.com/eclipse/lsp4jakarta.git

  2. Build the project with Maven by running the ./buildAll.sh script from the lsp4jakarta directory with Maven and Tycho. This script runs mvn clean install on the components in the following order:

    1. Builds Jakarta EE JDT LS Extension and runs automated tests

    2. Builds Jakarta EE Language Server, creating the org.eclipse.lsp4jakarta.ls-x.x.x-SNAPSHOT-jar-with-dependencies.jar

    3. Builds Eclipse client plug-in that consumes the Jakarta EE Language Server and runs automated tests, copies the org.eclipse.lsp4jakarta.ls-x.x.x-SNAPSHOT-jar-with-dependencies.jar to the ./jakarta.eclipse/org.eclipse.lsp4jakarta.lsp4jakarta.lsp4e.core/server/ directory

  3. Import jakarta.ls, org.eclipse.lsp4jakarta.core, org.eclipse.lsp4jakarta.tests and lsp4jakarta projects in Eclipse (File --> Open projects from file system --> Select your LSP4Jakarta clone)

    Eclipse project explorer

    You may also need to install Tycho Project Configurations to resolve Maven plug-in execution errors.

    Tycho configurator errors

    Discover m2e connectors Installing Tycho Project Configurators

  4. Ensure that the Java projects are being built with JavaSE-11 (Right-click project --> "Properties" --> "Java Build Path" --> "Libraries")

  5. Configure the Java build path for the org.eclipse.lsp4jakarta.lsp4e.core project:

    1. Right-click "org.eclipse.lsp4jakarta.lsp4e.core project" --> "Properties" --> "Java Build Path" --> "Libraries"

      lsp4e project build path
    2. Select "Add External JARs..." and point to the jar located at ./jakarta.eclipse/org.eclipse.lsp4jakarta.lsp4jakarta.lsp4e.core/server/org.eclipse.lsp4jakarta.ls-x.x.x-SNAPSHOT-jar-with-dependencies.jar

      lsp4e project build path add external jar lsp4e project build path selecting external jar lsp4e project build path confirming jar

Common Errors

  1. When setting up the Eclipse workspace:
     - Bundle 'org.apache.commons.lang3' cannot be resolved in Eclipse workspace
     Solution: #46

  2. If during initial setup mvn verify returns errors or compilation failures, verify that you are using JavaSE-11. You may have to configure $JAVA_HOME variable and make sure it is pointing to the correct location.

Running as an Eclipse application

Run org.eclipse.lsp4jakarta.lsp4e.core as an Eclipse Application to launch a new instance of Eclipse with LSP4Jakarta (Right-click on the org.eclipse.lsp4jakarta.lsp4e.core project, "Run As" --> "Eclipse Application"). A new Eclipse application will launch with the LSP4Jakarta Eclipse client plug-in installed.

Run lsp4e Eclipse plug-in

To Debug:

Debug org.eclipse.lsp4jakarta.lsp4e.core as an Eclipse Application to launch a new instance of Eclipse with LSP4Jakarta (Right-click on the org.eclipse.lsp4jakarta.lsp4e.core project, "Debug As" --> "Eclipse Application"). A new Eclipse application will launch with the LSP4Jakarta Eclipse client plug-in installed.

Debug lsp4e Eclipse plug-in