vscode-java: Unable to build vscode-java locally

[Unable to build vscode-java locally]

Environment
  • Operating System: macOS Ventura 13.5
  • JDK version: 17.0.4.1 (x86_64) “Oracle Corporation” - “Java SE 17.0.4.1”
  • Visual Studio Code version: N/A
  • Java extension version: 1.7.0
Steps To Reproduce
  1. Followed the steps on Contributing.md to clone vscode-java and eclipse.jdt.ls and following the file structure as mentioned on the Contributing page.
  2. execute npm run build-server command
Current Result
11:18 $ npm run build-server

> java@1.7.0 build-server
> ./node_modules/.bin/gulp build_server

[11:18:39] Using gulpfile ~/workspace/vscode-java-build-package/vscode-java/gulpfile.js
[11:18:39] Starting 'build_server'...
Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain
Caused by: java.lang.ClassNotFoundException: org.apache.maven.wrapper.MavenWrapperMain
[11:18:39] 'build_server' errored after 309 ms
[11:18:39] Error: Command failed: ./mvnw -Pserver-distro clean package -D eclipse.jdt.ls.skipGradleChecksums
    at checkExecSyncError (node:child_process:820:11)
    at Object.execSync (node:child_process:891:15)
    at /Users/alokre/workspace/vscode-java-build-package/vscode-java/gulpfile.js:129:5
    at taskWrapper (/Users/alokre/workspace/vscode-java-build-package/vscode-java/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (node:domain:426:15)
    at runBound (node:domain:437:12)
    at asyncRunner (/Users/alokre/workspace/vscode-java-build-package/vscode-java/node_modules/async-done/index.js:55:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:77:11)
Expected Result

Build the vsix image of vscode-java

Additional Informations

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 17 (6 by maintainers)

Most upvoted comments

@snjeza . reconfigured my local machine and reinstalled maven alongwith maven wrapper.

Had to run the following steps in eclipse.jdt.ls repo to get the environment configured properly.

mvn clean
mvn install
mvn wrapper:wrapper

And then running ./mvnw clean didnt throw the error: Error: Could not find or load main class org.apache.maven.wrapper.MavenWrapperMain.

Running npm run build-server then succeeded when running it from vscode-java repo.