i finally figured it out why i had so many problems with BREE
so for anybody that has the same thing i hope google will pick this up
i had 2 quite simple plugin kind of projects, they are more plugins because they are used by "real" eclipse plugins
but 1 of them is a bit bigger uses one or 2 other plugins. So that one has in its pom file a p2 repository so using this:
when i did add <useJDK>BREE</useJDK>
it worked for that one
but the other project is much simpler that doesn't have any repo to build, it doesn't have any plugin dependencies
This works fine for building with tycho
But at the moment you add
<useJDK>BREE</useJDK> and JAVA_HOME (that maven uses to run) is not java8 but already java12 or something like that.
then i still get that error that JavaSE-12 execution environment is not found, even if everything is correctly configured to use JavaSE-1.8
but with -X i looked carefully what now the difference is.. this happens with the one that goes wrong:
[INFO] Computing target platform for MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Using execution environment 'JavaSE-1.8' configured in Bundle-RequiredExecutionEnvironment (first entry)
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[DEBUG] Added 10 locally built units to the target platform
[INFO] Resolving dependencies of MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Using execution environment 'JavaSE-12' configured in current execution environment
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[DEBUG] Added 10 locally built units to the target platform
[ERROR] Internal error: java.lang.IllegalArgumentException: Could not find specification for custom execution environment profile 'JavaSE-12' in the target platform -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.IllegalArgumentException: Could not find specification for custom execution environment profile 'JavaSE-12' in the target platform
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (Unknown Source)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (Unknown Source)
at java.lang.reflect.Method.invoke (Unknown Source)
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)
Caused by: java.lang.IllegalArgumentException: Could not find specification for custom execution environment profile 'JavaSE-12' in the target platform
at org.eclipse.tycho.p2.target.ee.CustomEEResolutionHandler.findSpecificationUnit (CustomEEResolutionHandler.java:49)
at org.eclipse.tycho.p2.target.ee.CustomEEResolutionHandler.readFullSpecification (CustomEEResolutionHandler.java:38)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:200)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:128)
at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform (TargetPlatformFactoryImpl.java:1)
at org.eclipse.tycho.p2.manager.ReactorRepositoryManagerImpl.computePreliminaryTargetPlatform (ReactorRepositoryManagerImpl.java:84)
at org.eclipse.tycho.p2.resolver.P2DependencyResolver.computePreliminaryTargetPlatform (P2DependencyResolver.java:224)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveWithCurrentEE (DefaultTychoResolver.java:199)
at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:124)
at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:95)
the one that works:
[INFO] Computing target platform for MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Added p2 repository servoy (
http://download.eclipse.org/eclipse/updates/4.13/)
[DEBUG] Using execution environment 'JavaSE-1.8' configured in Bundle-RequiredExecutionEnvironment (first entry)
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[INFO] Fetching p2.index from
http://download.eclipse.org/eclipse/updates/4.13/[INFO] Adding repository
http://download.eclipse.org/eclipse/updates/4.13[INFO] Fetching p2.index from
http://download.eclipse.org/eclipse/updates/4.13/R-4.13-201909161045/[INFO] Fetching p2.index from
http://download.eclipse.org/eclipse/updates/4.13/R-4.13-201909161045/[DEBUG] Added 10 locally built units to the target platform
[INFO] Resolving dependencies of MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] Added p2 repository servoy (
http://download.eclipse.org/eclipse/updates/4.13/)
[DEBUG] Using execution environment 'JavaSE-12' configured in current execution environment
[DEBUG] Registered artifact repository org.eclipse.tycho.repository.registry.facade.RepositoryBlackboardKey(uri=file:/resolution-context-artifacts@C%253A%255CUsers%255Cjcomp%255Cgit%255Cservoy_master%255Cservoy-js-engine%255Corg.eclipse.dltk._javascript_.rhino)
[DEBUG] Added 10 locally built units to the target platform
[WARNING] The following locally built units have been used to resolve project dependencies:
[WARNING] org.eclipse.dltk._javascript_.rhino/2019.12.0.3540_rc
[INFO] Resolving class path of MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
and then it starts to compile fine.
So it seems that it needs to have a eclipse update site to get to some Execution environment
But both are saying
[DEBUG] Using execution environment 'JavaSE-12' configured in current execution environment
but i wonder what that is really about.. that seems to be something for that target platform.
It seems the compiler really uses something else. because if i make a type on the toolchain.xml and let it run again
Then the output above is the same..
But the compiler bombs out: (it seems to be nicely configured)
[DEBUG] Configuring mojo org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile from plugin realm ClassRealm[plugin>org.eclipse.tycho:tycho-compiler-plugin:1.4.0, parent: jdk.internal.loader.ClassLoaders$AppClassLoader@612fdc8c]
[DEBUG] Configuring mojo 'org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile' with basic configurator -->
[DEBUG] (f) basedir = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino
[DEBUG] (f) buildDirectory = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target
[DEBUG] (f) compilerId = jdt
[DEBUG] (f) copyResources = true
[DEBUG] (f) debug = true
[DEBUG] (f) encoding = UTF-8
[DEBUG] (f) fork = false
[DEBUG] (f) generatedSourcesDirectory = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\generated-sources\annotations
[DEBUG] (f) logDirectory = C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\compile-logs
[DEBUG] (f) optimize = false
[DEBUG] (f) outputFileName = org.eclipse.dltk._javascript_.rhino-2019.12.0.3540_rc
[DEBUG] (f) project = MavenProject: com.servoy:org.eclipse.dltk._javascript_.rhino:2019.12.0.3540_rc @ C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\pom.xml
[DEBUG] (f) requireJREPackageImports = false
[DEBUG] (f) session = org.apache.maven.execution.MavenSession@e6f1dd8c
[DEBUG] (f) showDeprecation = false
[DEBUG] (f) showWarnings = false
[DEBUG] (f) source = 1.8
[DEBUG] (f) staleMillis = 0
[DEBUG] (f) strictCompilerTarget = false
[DEBUG] (f) target = 1.8
[DEBUG] (f) useJDK = BREE
[DEBUG] (f) useProjectSettings = true
[DEBUG] (f) verbose = false
[DEBUG] -- end configuration --
[DEBUG] Manifest BREEs: [OSGi profile 'JavaSE-1.8' { source level: 1.8, target level: 1.8}]
[DEBUG] Effective EE: OSGi profile 'JavaSE-1.8' { source level: 1.8, target level: 1.8}
[DEBUG] Effective source/target: 1.8/1.8
[DEBUG] Using compiler 'jdt'.
[DEBUG] Source directories: [C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\src]
[DEBUG] Classpath: [C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\classes]
[DEBUG] Output directory: C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\classes
[DEBUG] Toolchain JDK[c:/javatools/jdk18/] doesn't match required property: id
[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile) on project org.eclipse.dltk._javascript_.rhino: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'JavaSE-1.8' found. See
http://maven.apache.org/guides/mini/guide-using-toolchains.html -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.4.0:compile (default-compile) on project org.eclipse.dltk._javascript_.rhino: useJDK = BREE configured, but no toolchain of type 'jdk' with id 'JavaSE-1.8' found. See
http://maven.apache.org/guides/mini/guide-using-toolchains.html
and when that is correct and i see this:
INFO] Compiling 327 source files to C:\Users\jcomp\git\servoy_master\servoy-js-engine\org.eclipse.dltk._javascript_.rhino\target\classes
[DEBUG] JDT compiler args:
and I analyse the args then that is correct it compiles against the jdk1.8 classpath
also I see that -warn:none is added to the compiler args but still it gives me loads of warnings
so it seems that is not a tycho problem but somewhere a configuration or jdk compiler problem?