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

Unknown OSGi execution environment: 'JavaSE-19' #958

Closed
cushon opened this issue May 11, 2022 · 8 comments · Fixed by #995
Closed

Unknown OSGi execution environment: 'JavaSE-19' #958

cushon opened this issue May 11, 2022 · 8 comments · Fixed by #995
Milestone

Comments

@cushon
Copy link

cushon commented May 11, 2022

I'm seeing the following error trying to use tycho with a JDK 19-ea:

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:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
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:[65](https://github.com/google/google-java-format/runs/6392813704?check_suite_focus=true#step:5:65)2)
    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:253)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
@akurtakov
Copy link
Member

@jarthana are you going to add support for Java 19?

@jarthana
Copy link
Contributor

Yes, we have just commenced the work on Java 19 and very soon will require our tests to be running with JavaSE-19. Will get to it soon. Thanks for the bug Liam. Will keep this issue on my plate.

@mickaelistria
Copy link
Contributor

I suspect this is a Tycho issue anyway. In the current state, Tycho is incapable of starting a build when running a Java version that is more recent that the one known by Tycho (as a .profile file) at the time of the release. This is a too big restriction.
I think this is coming from 2.7 and addition of more work in the early lifecycle (cc @laeubi ).
And I believe applyBestOfCurrentOrConfiguredProfile would need to be changed to use the latest known profile as default in this case.

@mickaelistria
Copy link
Contributor

I think this is coming from 2.7 and addition of more work in the early lifecycle (cc @laeubi ).

This was more a question and I forgot the question mark. But anyway, it seems mostly wrong as I could reproduce this issue with Tycho 2.5. I still believe that we can make it work to choose a better default EE instead of failing in that case.

@laeubi
Copy link
Member

laeubi commented May 16, 2022

Tycho chooses the JDK as a default it is running with as this is most likely the choice a user want to have (every other default would be rather arbitrary and questionable). If one don't want this the desired Java version should be either configured in the pom or in the target, so Tycho knows what to choose here.

We can change of course Tycho to fall back to a lower JDK version, but think there should be a strong warning then, as mostly the lowest one is also the lowest we can compile with EJC so likely that approach would just fail later on if one uses never features EJC do not understand.

@laeubi
Copy link
Member

laeubi commented May 26, 2022

I think we can at least improve tycho in a way that it generates missing profiles here for the running VM using the JREAction of P2.
@cushon do you think you can provide a minimal example with build instructions to reproduce the issue? Maybe even
provide it as an integration-test to demonstrate the issue? I could then propose a fix for this.

@laeubi laeubi linked a pull request Jun 3, 2022 that will close this issue
@laeubi laeubi added this to the 3.0 milestone Sep 21, 2022
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479345457
copybara-service bot pushed a commit to google/google-java-format that referenced this issue Oct 6, 2022
To include the fix for eclipse-tycho/tycho#958

PiperOrigin-RevId: 479370465
@Saymama
Copy link

Saymama commented Oct 19, 2022

I'm seeing the following error trying to use tycho with a JDK 19-ea:

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:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
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:[65](https://github.com/google/google-java-format/runs/6392813704?check_suite_focus=true#step:5:65)2)
    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:253)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    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:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

@laeubi
Copy link
Member

laeubi commented Oct 19, 2022

@Saymama are you using Tycho 3.0?

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

Successfully merging a pull request may close this issue.

6 participants