microsoft / vscode-java-test

Run and debug Java test cases in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-test
Other
292 stars 125 forks source link

Unknown OSGi execution environment #1630

Closed gataky closed 10 months ago

gataky commented 10 months ago

I'm trying to build this project locally and running into issues with the execution environemnt not been recognized.

I'm running with what I believe to be a supported java version on a mac m1 Sonoma 14.1

17:27:~/.config/vscode-java-test:[main ✗] java -version
openjdk version "17.0.9" 2023-10-17 LTS
OpenJDK Runtime Environment Corretto-17.0.9.8.1 (build 17.0.9+8-LTS)
OpenJDK 64-Bit Server VM Corretto-17.0.9.8.1 (build 17.0.9+8-LTS, mixed mode, sharing)

But whenever I try and build I get this error.

16:21:~/.config/vscode-java-test:[main ✗] npm run build-plugin

> vscode-java-test@0.40.1 build-plugin
> node scripts/buildJdtlsExt.js

[INFO] Scanning for projects...
[ERROR] Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-19' -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-19'
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:122)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:993)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:345)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:191)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:578)
        at org.apache.maven.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:39)
        at org.apache.maven.wrapper.WrapperExecutor.execute(WrapperExecutor.java:122)
        at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:60)
Caused by: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-19'
        at org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils.getExecutionEnvironment(ExecutionEnvironmentUtils.java:96)
        at org.eclipse.tycho.core.osgitools.OsgiBundleProject.applyBestOfCurrentOrConfiguredProfile(OsgiBundleProject.java:682)
        at org.eclipse.tycho.core.osgitools.OsgiBundleProject.readExecutionEnvironmentConfiguration(OsgiBundleProject.java:652)
        at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject(DefaultTychoResolver.java:108)
        at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:111)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:267)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
        ... 14 more
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException
node:child_process:965
    throw err;
    ^

Error: Command failed: ./mvnw clean verify
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at Object.<anonymous> (/Users/jeffor/.config/vscode-java-test/scripts/buildJdtlsExt.js:30:4)
    at Module._compile (node:internal/modules/cjs/loader:1241:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
    at Module.load (node:internal/modules/cjs/loader:1091:32)
    at Module._load (node:internal/modules/cjs/loader:938:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 93549,
  stdout: null,
  stderr: null
}

Node.js v20.9.0

I've tried with a number of different java versions too (19, 11, and 8) they all produce the same error.

I've also tried checking out different versions of this repo with no luck there either.

Is there something obvious that I'm missing? Sorry I'm new to java so not sure what I can provide to help troubleshoot this.

jdneo commented 10 months ago

Have you set the JAVA_HOME env variable to the home of JDK17 installation?

gataky commented 10 months ago

@jdneo I could have sworn I set that but checked again and sure enough it wasn't. Thank you so much for pointing that out and sorry for the bone headed issue.