Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tycho generates "Unknown OSGi execution environment: 'JavaSE-20'" error upon Maven 'clean install' command #99

Open
StephenF55 opened this issue Jul 24, 2023 · 8 comments

Comments

@StephenF55
Copy link

Hi,
I get the above error when I try to perform the "Build the language" step (step 2) of the procedure. That is running "mvn clean install" from my 'git\maven-xtext-example' directory. The exact errors produced are:

[ERROR] Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-20' -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-20'
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:109)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
Caused by: org.eclipse.tycho.core.ee.UnknownEnvironmentException: Unknown OSGi execution environment: 'JavaSE-20'
at org.eclipse.tycho.core.ee.ExecutionEnvironmentUtils.getExecutionEnvironment (ExecutionEnvironmentUtils.java:96)
at org.eclipse.tycho.core.osgitools.OsgiBundleProject.applyBestOfCurrentOrConfiguredProfile (OsgiBundleProject.java:778)
at org.eclipse.tycho.core.osgitools.OsgiBundleProject.readExecutionEnvironmentConfiguration (OsgiBundleProject.java:748)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.setupProject (DefaultTychoResolver.java:103)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:111)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:223)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:910)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:283)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:206)
at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:104)
at java.lang.reflect.Method.invoke (Method.java:578)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:283)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:226)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:407)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:348)
[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

Please note that the preceding "Increase memory" step 1 did NOT work for me, as when I try the command (or at least the equivalent windows - I am using Windows 11 machine - to the Unix one) given, the subsequent 'clean install' generates the following error:

C:\Users\Alison\git\maven-xtext-example>set MAVEN_OPTS="-Xmx512m -XX:MaxPermSize=256m"

C:\Users\Alison\git\maven-xtext-example>mvn clean install
Invalid maximum heap size: -Xmx512m -XX:MaxPermSize=256m
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

@cdietrich
Copy link
Member

cdietrich commented Jul 24, 2023

Xtext has no offical java 20 support. also dont know if the mavern or tycho version you use has
MaxPermSize needs to be removed

@cdietrich
Copy link
Member

@StephenF55
Copy link
Author

Hi Christian, Many thanks for replying so promptly.

I'd like to align my environment, so please can you advise what Maven and Tycho versions you use? Note that I have Maven v3.9.2 installed, whilst Tycho is v2.7.5 (per the parent pom definition)

@cdietrich
Copy link
Member

this both should work,
question is what java version you use. should be 17

@StephenF55
Copy link
Author

Thanks for confirming Maven & Tycho.
Ok, I'll try 17 instead of 20

@StephenF55
Copy link
Author

StephenF55 commented Jul 24, 2023

Thank you very much Christian, switching Java from '20' to '17' fixed the problem. Maven clean install now builds fine in the command line.

However, rather frustratingly, I am still seeing the attached 4 errors and multiple hundred warnings in Eclipse. Do you have any suggestions what the problem might be? Note that the Eclipse version I'm running is:

Eclipse DSL Tools (includes Incubating components)
Version: 2023-03 (4.27.0)
Build id: 20230309-1520

eclipse errors & warnings@24_07_23.xlsx

@cdietrich
Copy link
Member

examples should be imported in runtime project only
the discouraged access and deprecated warnings are expected.

@StephenF55
Copy link
Author

Understood. Thanks again for your help Christian, much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants