- This topic has 3 replies, 2 voices, and was last updated 4 years ago by knowledgeplaces.
-
AuthorPosts
-
knowledgeplacesParticipantI have complex SQL requests to write and i want to take advantage of Java 14 preview feature “text block”.
I have properly configured MyEclipse to use Java 14 using the –enable-preview parameter.
I have also added the –enable-preview parameter in Java Windows setting, and done whar is recommended here:
https://dev.dexterxx.pl/news/8When I code my Java classes in MyEclipse, it’s fine, I can use text blocks.
However, when I build and run the application on Tomcat 9, I have the following error message:
java.lang.UnsupportedClassVersionError: Preview features are not enabled for com/knowledgeplaces/metalmsapi/SigninResource (class file version 58.65535). Try running with ‘–enable-preview’ (impossible de charger la classe [com.knowledgeplaces.metalmsapi.SigninResource])Sounds like the feature is not enabled in the complied class file.
Please advise.
Brian FernandesModeratorI don’t believe the
--enable-preview
parameter is required for MyEclipse, if you’re using our latest 2020.9.16 release. Please see this page for instructions: https://www.eclipse.org/eclipse/news/4.16/jdt.php – you can follow those steps at the workspace level (in preferences) or at the project level (in project properties) too.Assuming you have the project JDK set to Java 14 and the preview features turned on, the compiled code should now work. Please let us know if this works for you.
knowledgeplacesParticipantI had already done what is written in this page.
However, when I select my Java project by right-clicking on it and selecting Configure > Enable preview features, the “Enable preview feature” menu is greyed, I can’t click on it.
So it sounds like these features are not really applied to my project.
How to enable this menu option?
knowledgeplacesParticipantFound it!
I needed to add –enable-preview as Java VM default argument (see attached screen copy).Attachments:
You must be logged in to view attached files. -
AuthorPosts