-
Notifications
You must be signed in to change notification settings - Fork 189
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
Use tycho-compiler-plugin to compile for Java 20 (and --enable-preview) #2324
Comments
Previously we used Java 19 (which obviously is in the list of acceptable target levels We are using latest Maven 3.9.1. |
Tycho does not use javac but ecj that seem to not support java 20 yet but will after the next release (in June 2023), there is an option to use other compilers: https://tycho.eclipseprojects.io/doc/latest/tycho-compiler-plugin/compile-mojo.html#compilerId but I suspect this is experimental/unsupported as I can't find a single example / test in Tycho that actually uses javac. So the question would be how important that is for you and how much effort you want to put into this or if it is an option to just wait for the next ejc release. |
Hi, I know about the https://tycho.eclipseprojects.io/doc/latest/tycho-compiler-plugin/compile-mojo.html#compilerId, but I can't see to get any to work. It is most urgent for us to be able to compile now and cannot wait until June. We will use next Eclipse 2023-06 M1 as soon as it is available (end of week I think), but that will probably not resolve our Maven build problems. What is the Would it otherwise be possible to set-up |
As said I think no one ever tried that and it is probably even not possible at all, but if this is crucial to your business and likes to speed up the development in that area a sponsoring would allow me to assign more time-slots particular issue, or you can contact me to enter a contract to implement a specific feature.
The main problem is that Milestones are not deployed to central see this topic: But if we assume that M1 contains the necessary stuff and you can use the above mentioned snapshot repository, it should be possible to use the snapshot until june and configure Tycho like this:
|
For now it doesn't work. Perhaps I have done something wrong. This is what I did in the beginning of our main <!-- Eclipse ecj compiler SNAPSHOT for Java 20 -->
<pluginRepositories>
<pluginRepository>
<id>org.eclipse.ecj-3.34.0-SNAPSHOT</id>
<url>https://repo.eclipse.org/content/repositories/eclipse-snapshots/org/eclipse/jdt/ecj/3.34.0-SNAPSHOT/</url>
</pluginRepository>
</pluginRepositories> And then the modified and cleaned up <plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<!-- Temp fix until 2023-06 is released - BEGIN -->
<dependencies>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.34.0-SNAPSHOT</version>
</dependency>
</dependencies>
<!-- Temp fix until 2023-06 is released - END -->
<configuration>
<useProjectSettings>true</useProjectSettings>
<optimize>true</optimize>
<debug>true</debug> <!-- ProGuard takes away the debug info -->
<encoding>UTF-8</encoding>
<release>${java.complier.release.version}</release>
<compilerArgument>--enable-preview</compilerArgument>
<verbose>true</verbose>
</configuration>
</plugin> The Maven build picks up and reads the definitions from the pluginrepository Did I do something wrong, or are there just missing things in the
|
The repo name URL for the snapshot should be https://repo.eclipse.org/content/repositories/eclipse-snapshots/ |
This definition in the beginning of the main We now build a a version of our product IIZI based on Eclipse 2023-03 + patch for Java 20 for Win64, macOS Intel+Apple and Linux aarch64+x86-64 with JustJ version 20.0.0 and Jetty version 12 (!) beta0 (Jakarta EE 10+9+8, etc), all using Java 20 with preview features enabled and using virtual threads... We target the release when Jetty12 is ready along with Java 21, so I guess our IIZI product will be based on Eclipse 2023-09 or 2023-12. Thank you for your help! <!-- Eclipse SNAPSHOTS -->
<pluginRepositories>
<pluginRepository>
<id>org.eclipse.SNAPSHOTS</id>
<url>https://repo.eclipse.org/content/repositories/eclipse-snapshots/</url>
</pluginRepository>
</pluginRepositories> The plugin definition lower down in the main <!-- Tycho Compile plugin projects -->
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-compiler-plugin</artifactId>
<version>${tycho.version}</version>
<!-- Temp fix until 2023-06 is released - BEGIN -->
<dependencies>
<dependency>
<groupId>org.eclipse.jdt</groupId>
<artifactId>ecj</artifactId>
<version>3.34.0-SNAPSHOT</version>
</dependency>
</dependencies>
<!-- Temp fix until 2023-06 is released - END -->
<configuration>
<useProjectSettings>true</useProjectSettings>
<optimize>true</optimize>
<debug>true</debug> <!-- ProGuard takes away the debug info -->
<encoding>UTF-8</encoding>
<release>${java.complier.release.version}</release>
<compilerArgument>--enable-preview</compilerArgument>
<compilerArgument>-warn:none</compilerArgument>
<compilerArgument>-err:none</compilerArgument>
<verbose>true</verbose>
</configuration>
</plugin> |
We have tried long and hard to get this to work. We have tried Tycho 3.0.4, 3.0.5-SNAPSHOT, 3.10-SNAPSHOT, 4.0.0-SNAPSHOT, but it just doesn't work or we don't know how to use e.g.
javac
from Temurin-20+36 or alike. We use toolchains, and they have been working perfectly the last years.All our projects require
JavaSE-20
+--enable-preview
and are Eclipse plugin projects.Replace
${tycho.version}
below with3.0.4
or one of the SNAPSHOT versions above, it will not make a change.Basically, the Java version 20 is not accepted:
target level should be in '1.1'...'1.8','9'...'19' (or '5.0'..'19.0') or cldc1.1: 20
.The result from a Maven build looks like:
The text was updated successfully, but these errors were encountered: