-
Notifications
You must be signed in to change notification settings - Fork 21
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
JSPs can't be compiled on Java 17+ #18
Comments
@tjwatson Can you give some hints how we should proceed here ? Or point to someone we can ask for help? This is general issue in Equinox Servlet support. |
What I don't get is why we need to update jdt.core used by jasper simply to run and compile on Java 17+ I would think that would only be required if the JSPs actually used Java 17 language features. Shouldn't the old jdt.core used by jasper still be able to compile existing JSPs regardless of the version of Java we are running on? |
I didn't manage to tell Jasper what bytecode version it should compile jsp files to and it keeps using the running JVM version for that. |
Can't we precompile jsp's and ship them as classes? |
That would be workaround for our jsp files . Help system provides the capabilities for contributors to ship jsp files so these would still be broken. |
From the bugzilla:
So maybe just the compiler could be provided as an additional bundle then if its too hard to update the glassfish? Maybe it would even be better if glassfish is not embedding anything at all and instead get it from the outside? |
Maybe jasper should then simply use https://docs.oracle.com/javase/7/docs/api/javax/tools/JavaCompiler.html ? |
I'll probably add dependency on jdt.core as that's the only thing we can control on our side. I failed at even finding decent jasper replacement. The "original" one from Tomcat brings too many tomcat dependencies so a no-go. |
Maybe its even enough to add ECJ as dependency? |
That should be org.eclipse.jdt.core.compiler.batch. If it's enough sure. |
I just checked and o.e.jdt.core.compiler.batch is 3.1MB but is not included in Eclipse SDK while o.e.jdt.core is 6.7 MB but is already there. I'm kind of torn which one to prefer. |
Would "import package" help? In SDK this would be jdt core. Other products could try to get ecj, but I'm not sure if it is even deployed in the p2 repo. I know it is provided as separated download. |
I will go that path. |
ECJ is not packaged in SDK. also this consists of classes from
you'll probably need o.e.jdt.core.compiler.apt also for annotation processing. |
JSPs don't do annotation processing AFAICT so Import-Package: org.eclipse.jdt.core.compiler seems to do the trick at least for what I have tested. |
ECJ does exist in p2 repo. but it is not packaged in any of the products. If required we can go that way. I think adding ecj to help.feature may also work. |
Please look at the PR. I would like to go as less invasive as possible here and this sounds like the minimal patch. |
Jasper shipped embeds ancient version of ecj which doesn't support targeting newer Java versions. As Eclipse is the author of ecj it makes sense to include our own version which is the absolute latest one. Removed workaround in tests explicitly adding jdt.core that is no longer needed Fixes #18
I'm a bit confused, does JDT not use EJC so anything that contains JDT should also include ECJ? Just wondering :-) |
I'm not an expert on the topic too but from looking at contents of jar files - ECJ seems to be called the standalone compiler at the download page while o.e.jdt.core is Eclipse plugin with dependency on core.resources and etc. Both contain org.eclipse.jdt.core.compiler package and friends but they are not 1:1 replacements. |
ECJ jar is subset of JDT core bundle, it is standalone compiler library only. So it would be enough to require ecj if it would be there, but it isn't, and shipping both bundles with SDK doesn't make sense. However, consumers not interested in JDT don't need to include it and could use ECJ only, also avoiding that they would use JDT core API that aren't running without the rest of dependencies JDT has. |
Y-build failed with this error
Full log https://ci.eclipse.org/releng/job/Y-build-4.25/18/console |
jdt core requires resources, ecj not... |
@sravanlakkimsetti I'm out of ideas how to proceed as I don't want to mandate second copy of ecj. Please revert (or tell me to do so) if you want to urge Y-build. |
Why can'T we have an ECJ bundle and JDT just consume this? |
If I-build succeeds, I don't have any problem with this one. Lets wait for the I-build and see if I-build succeeds. If not we should revert. |
Split packages etc. This would require JDT deployment to be refactored, so JDT consumes ecj for some packages, not sure how easy that is and if that would open another can of worms.
Require platform resources bundle? Shouldn't be a big issue for SDK but will be if the help is used standalone. Activation of JDT bundle will trigger activation of resources, which could fail without workspace set or trigger write access to $home/workspace which might also fail... There is a hack possible: JDT core could declare resources bundle dependency "optional", I assume no one uses JDT without resources bundle anyway. The compiler code in theory should not depend on resources (ecj runs standalone), but not sure if that also true if the entire jdt core bundle is on classpath. |
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one should be renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and be a proper maven library. It is actually the ecj compiler library without any dependencies, that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: org.eclipse.jdt.internal.compiler org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they would be inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - eclipse-jdt#181 - eclipse-platform/eclipse.platform.ua#18
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - eclipse-jdt#181 - eclipse-platform/eclipse.platform.ua#18
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - eclipse-jdt#181 - eclipse-platform/eclipse.platform.ua#18
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - #181 - eclipse-platform/eclipse.platform.ua#18
We are done here via 3a6e2d9 |
Tested our RCP app against 4.27.0.I20221206-1800 and can confirm this is working. Thanks! |
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - #181 - eclipse-platform/eclipse.platform.ua#18
I think the |
Do you like open a PR with your proposal? |
I've created #78 to add require bundle version range for Reading through groovy/groovy-eclipse#1425 I assume the PR should be for https://projects.eclipse.org/projects/technology.packaging/ project which seem to still use gerrit for reviews, see https://git.eclipse.org/c/epp/org.eclipse.epp.packages.git/ / has no github repo. If so, we need a change in org.eclipse.epp.package.common.feature/feature.xml that replaces require bundle from |
Yes, EPP is still using Gerrit. I created an Oomph setup for EPP a while back, so it's very easy to create an IDE for contributing to EPP... |
Ed or @jonahgraham: may I ask you to update this feature file, should be easy to setup :-) ? |
I already have one set up so yes, it's super easy for me to do that for you. But I wonder now exactly what is correct though... I can of course easily change the common feature like this: But this means that packages that install @iloveeclipse I assume it's redundant to install |
I have a feeling that the changes made in the platform are sufficient already. E.g., the CDT package already installs https://git.eclipse.org/r/c/epp/org.eclipse.epp.packages/+/197791 |
Yes, sure, this is the right thing to do, I somehow missed the fact the entire commit can be reverted. |
I wonder if this issue is done now? |
Why wondering, if you have merged the last PR :-) ? |
Will there be an update available for the Eclipse 4.26 (2022‑12) release? |
No, but 4.26 should be working fine by requiring org.eclipse.jdt.core just few more extra dependencies bringed in. |
4.26 is not working fine for any feature that tries to patch the JDT Core bundle. See groovy/groovy-eclipse#1425 |
The org.eclipse.help.webapp bundle already specify the necessary requirements for JSPs to compile. eclipse-platform/eclipse.platform.ua#18 Change-Id: I35c36a68ee0e2b80cc4abe5656219e4501b05fce
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - eclipse-jdt#181 - eclipse-platform/eclipse.platform.ua#18
The org.eclipse.jdt.core.ecj.validation was a "dummy" bundle so far, used only to validate compilation issues in IDE. That one is renamed (org.eclipse.jdt.core.ecj.validation -> org.eclipse.jdt.core.compiler.batch) and is a proper maven library now. It is actually the ecj compiler library without any dependencies (except optional ant), that could be consumed by JDT and the rest of the world. It must be required and re-exported by JDT core. Unfortunately, there are two split packages: - org.eclipse.jdt.internal.compiler - org.eclipse.jdt.internal.compiler.parser So the new bundle exports them to jdt.core and jdt.core re-exports. org.eclipse.jdt.compiler.apt and org.eclipse.jdt.compiler.tool were fragments of jdt.core, now they are inside org.eclipse.jdt.core.compiler.batch. TODO: 1) What I did NOT tried is to re-write all the magic scripts that build and package separated ecj library out of jdt.core. 2) The 3 antadapter classes are now split over ecj and jdt core, because BuildJarIndex.java and CheckDebugAttributes.java depend on JDT core code. 3) ecj.1 and build_ecj.xml aren't touched yet. ecj.1 was touched last time 2017, it seem to be used for man pages. 4) pom from jdt core will need an adoption. 5) org.eclipse.jdt-feature need to be updated 6) TBC See - eclipse-jdt#181 - eclipse-platform/eclipse.platform.ua#18
https://bugs.eclipse.org/bugs/show_bug.cgi?id=578221 is the original bug. In order to fix our build compilation I had to do b459090 to provide latest JDT.
But this effectively means Help system fails badly without jdt.core. We should find a way to update to jasper compiler with recent enough jdt.core bundled in it.
The text was updated successfully, but these errors were encountered: