[jira] [Commented] (NETBEANS-5491) UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I cannot run a project created in Java 15.
[ https://issues.apache.org/jira/browse/NETBEANS-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17326803#comment-17326803 ] Michal Rama commented on NETBEANS-5491: --- This is one of the classes in that troubled existing project. If I create a new project (in Java 15) and then switch it to Java 16, then there is no problem. {code:java} import javafx.scene.Scene; import javafx.scene.layout.HBox; import javafx.scene.paint.Color; import javafx.scene.text.Font; import javafx.scene.text.Text; import javafx.scene.text.TextBoundsType; import javafx.stage.Stage; public class TextHeightInPixel extends javafx.application.Application { @Override public void start(Stage stage) { var text = new Text("I"); text.setBoundsType(TextBoundsType.VISUAL); text.setFont(Font.loadFont(getClass().getResourceAsStream("GT Pressura Mono Regular Regular.ttf"), 100)); var pane = new HBox(text); text.setFill(Color.BLUE); var scene = new Scene(pane, 700, 400); setPixelHeight(scene, text, 99); stage.setScene(scene); stage.show(); } public static void setPixelHeight(Scene scene, Text text, int size) { for (var i = size + 1;; i++) { text.setStyle("-fx-font-size:" + i + ";"); var pixelReader = scene.snapshot(null).getPixelReader(); if (!(pixelReader.getColor(0, size)).equals(pixelReader.getColor(0, size + 1))) { break; } } } public static void main(String[] args) { launch(args); } } {code} This is a simple program that sets the desired height in pixels. ([Font|https://www.onlinewebfonts.com/download/226f58ab113a6d821def90a7d6dc2427]) > UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I > cannot run a project created in Java 15. > --- > > Key: NETBEANS-5491 > URL: https://issues.apache.org/jira/browse/NETBEANS-5491 > Project: NetBeans > Issue Type: Bug > Components: java - Platform, java - Project, java - Source >Affects Versions: 12.3 > Environment: Windows 10, Apache NetBeans 12.3, Java 16 >Reporter: Michal Rama >Assignee: Svatopluk Dedic >Priority: Blocker > Labels: java, platform, project, runtime, version > Attachments: obr�zek02.png, obr�zek41.png > > > Hello, > I installed Java 16 and set it in the etc\netbeans.conf file > *netbeans_jdkhome="C:\Program Files\Java\jdk-16"* > However, upon startup, all projects reported an error. NetBeans automatically > set the *Java Platform* to *JDK 16* for them, but the *Source / Binary > Format* was still *JDK 15*. > !obr�zek41.png! > !obr�zek02.png! > So it was enough to change it to JDK 16, except for one project that still > can't be run and I didn't figure out why. > To run this project I need to close NetBeans and run it again in Java 15. > Creating a new project in Java 16 would probably solve the problem, but why > should I do it when there was no problem with all the other projects. > Please help. > Thank you > PS. > {code:java} > run: > Error: LinkageError occurred while loading main class example.TextHeight > java.lang.UnsupportedClassVersionError: example/TextHeight (class file > version 59.65535) was compiled with preview features that are unsupported. > This version of the Java Runtime only recognizes preview features for class > file version 60.65535 > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:111: > The following error occurred while executing this line: > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:68: > Java returned: 1 > BUILD FAILED (total time: 1 second) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-5491) UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I cannot run a project created in Java 15.
[ https://issues.apache.org/jira/browse/NETBEANS-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17325551#comment-17325551 ] Svatopluk Dedic commented on NETBEANS-5491: --- The important message is: {code:java} Error: LinkageError occurred while loading main class example.TextHeight java.lang.UnsupportedClassVersionError: example/TextHeight (class file version 59.65535) was compiled with preview features that are unsupported. This version of the Java Runtime only recognizes preview features for class file version 60.65535 {code} this indicates that either 'preview' features were enabeld by the user (= user error) and the class should be recompiled, or NetBeans somehow messed in with e.g. compile-on-save feature. It may indicate a broader issue, although it may surface (in this case) on JDK16 only. [~Michal_cat] could you please try to create a _minimal_ sample project and attach it here ? *TextHeight* class is likely to be involved. > UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I > cannot run a project created in Java 15. > --- > > Key: NETBEANS-5491 > URL: https://issues.apache.org/jira/browse/NETBEANS-5491 > Project: NetBeans > Issue Type: Bug > Components: java - Platform, java - Project, java - Source >Affects Versions: 12.3 > Environment: Windows 10, Apache NetBeans 12.3, Java 16 >Reporter: Michal Rama >Priority: Blocker > Labels: java, platform, project, runtime, version > Attachments: obr�zek02.png, obr�zek41.png > > > Hello, > I installed Java 16 and set it in the etc\netbeans.conf file > *netbeans_jdkhome="C:\Program Files\Java\jdk-16"* > However, upon startup, all projects reported an error. NetBeans automatically > set the *Java Platform* to *JDK 16* for them, but the *Source / Binary > Format* was still *JDK 15*. > !obr�zek41.png! > !obr�zek02.png! > So it was enough to change it to JDK 16, except for one project that still > can't be run and I didn't figure out why. > To run this project I need to close NetBeans and run it again in Java 15. > Creating a new project in Java 16 would probably solve the problem, but why > should I do it when there was no problem with all the other projects. > Please help. > Thank you > PS. > {code:java} > run: > Error: LinkageError occurred while loading main class example.TextHeight > java.lang.UnsupportedClassVersionError: example/TextHeight (class file > version 59.65535) was compiled with preview features that are unsupported. > This version of the Java Runtime only recognizes preview features for class > file version 60.65535 > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:111: > The following error occurred while executing this line: > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:68: > Java returned: 1 > BUILD FAILED (total time: 1 second) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-5491) UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I cannot run a project created in Java 15.
[ https://issues.apache.org/jira/browse/NETBEANS-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308138#comment-17308138 ] Michal Rama commented on NETBEANS-5491: --- You're right. If the versions don't differ much, there is a chance that some things will work without support. Anyway, when will the version with JDK 16 support be released? I mean Daily build. > UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I > cannot run a project created in Java 15. > --- > > Key: NETBEANS-5491 > URL: https://issues.apache.org/jira/browse/NETBEANS-5491 > Project: NetBeans > Issue Type: Bug > Components: java - Platform, java - Project, java - Source >Affects Versions: 12.3 > Environment: Windows 10, Apache NetBeans 12.3, Java 16 >Reporter: Michal Rama >Priority: Blocker > Labels: java, platform, project, runtime, version > Attachments: obr�zek02.png, obr�zek41.png > > > Hello, > I installed Java 16 and set it in the etc\netbeans.conf file > *netbeans_jdkhome="C:\Program Files\Java\jdk-16"* > However, upon startup, all projects reported an error. NetBeans automatically > set the *Java Platform* to *JDK 16* for them, but the *Source / Binary > Format* was still *JDK 15*. > !obr�zek41.png! > !obr�zek02.png! > So it was enough to change it to JDK 16, except for one project that still > can't be run and I didn't figure out why. > To run this project I need to close NetBeans and run it again in Java 15. > Creating a new project in Java 16 would probably solve the problem, but why > should I do it when there was no problem with all the other projects. > Please help. > Thank you > PS. > {code:java} > run: > Error: LinkageError occurred while loading main class example.TextHeight > java.lang.UnsupportedClassVersionError: example/TextHeight (class file > version 59.65535) was compiled with preview features that are unsupported. > This version of the Java Runtime only recognizes preview features for class > file version 60.65535 > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:111: > The following error occurred while executing this line: > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:68: > Java returned: 1 > BUILD FAILED (total time: 1 second) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-5491) UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I cannot run a project created in Java 15.
[ https://issues.apache.org/jira/browse/NETBEANS-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308131#comment-17308131 ] Geertjan Wielenga commented on NETBEANS-5491: - When something isn't supported, i.e., JDK 16 in this case, then some things work and some things don't. It's unpredictable. JDK 16 is not supported, anything that works for you is great, and anything that doesn't is as expected. > UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I > cannot run a project created in Java 15. > --- > > Key: NETBEANS-5491 > URL: https://issues.apache.org/jira/browse/NETBEANS-5491 > Project: NetBeans > Issue Type: Bug > Components: java - Platform, java - Project, java - Source >Affects Versions: 12.3 > Environment: Windows 10, Apache NetBeans 12.3, Java 16 >Reporter: Michal Rama >Priority: Blocker > Labels: java, platform, project, runtime, version > Attachments: obr�zek02.png, obr�zek41.png > > > Hello, > I installed Java 16 and set it in the etc\netbeans.conf file > *netbeans_jdkhome="C:\Program Files\Java\jdk-16"* > However, upon startup, all projects reported an error. NetBeans automatically > set the *Java Platform* to *JDK 16* for them, but the *Source / Binary > Format* was still *JDK 15*. > !obr�zek41.png! > !obr�zek02.png! > So it was enough to change it to JDK 16, except for one project that still > can't be run and I didn't figure out why. > To run this project I need to close NetBeans and run it again in Java 15. > Creating a new project in Java 16 would probably solve the problem, but why > should I do it when there was no problem with all the other projects. > Please help. > Thank you > PS. > {code:java} > run: > Error: LinkageError occurred while loading main class example.TextHeight > java.lang.UnsupportedClassVersionError: example/TextHeight (class file > version 59.65535) was compiled with preview features that are unsupported. > This version of the Java Runtime only recognizes preview features for class > file version 60.65535 > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:111: > The following error occurred while executing this line: > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:68: > Java returned: 1 > BUILD FAILED (total time: 1 second) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-5491) UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I cannot run a project created in Java 15.
[ https://issues.apache.org/jira/browse/NETBEANS-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308129#comment-17308129 ] Michal Rama commented on NETBEANS-5491: --- I'm sorry, I didn't think of that. Anyway, I set the NetBeans runtime to JDK 16. Still, it can be run and everything seems OK. I can create a new project that also works. And the second existing project works, for which I only changed the version. So then I don't understand how he can't support it when everything (except my specific project) seems to work? > UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I > cannot run a project created in Java 15. > --- > > Key: NETBEANS-5491 > URL: https://issues.apache.org/jira/browse/NETBEANS-5491 > Project: NetBeans > Issue Type: Bug > Components: java - Platform, java - Project, java - Source >Affects Versions: 12.3 > Environment: Windows 10, Apache NetBeans 12.3, Java 16 >Reporter: Michal Rama >Priority: Blocker > Labels: java, platform, project, runtime, version > Attachments: obr�zek02.png, obr�zek41.png > > > Hello, > I installed Java 16 and set it in the etc\netbeans.conf file > *netbeans_jdkhome="C:\Program Files\Java\jdk-16"* > However, upon startup, all projects reported an error. NetBeans automatically > set the *Java Platform* to *JDK 16* for them, but the *Source / Binary > Format* was still *JDK 15*. > !obr�zek41.png! > !obr�zek02.png! > So it was enough to change it to JDK 16, except for one project that still > can't be run and I didn't figure out why. > To run this project I need to close NetBeans and run it again in Java 15. > Creating a new project in Java 16 would probably solve the problem, but why > should I do it when there was no problem with all the other projects. > Please help. > Thank you > PS. > {code:java} > run: > Error: LinkageError occurred while loading main class example.TextHeight > java.lang.UnsupportedClassVersionError: example/TextHeight (class file > version 59.65535) was compiled with preview features that are unsupported. > This version of the Java Runtime only recognizes preview features for class > file version 60.65535 > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:111: > The following error occurred while executing this line: > C:\Users\NAME_OF_USER\AppData\Local\NetBeans\Cache\12.3\executor-snippets\run.xml:68: > Java returned: 1 > BUILD FAILED (total time: 1 second) > {code} -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-5491) UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I cannot run a project created in Java 15.
[ https://issues.apache.org/jira/browse/NETBEANS-5491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17308111#comment-17308111 ] Geertjan Wielenga commented on NETBEANS-5491: - NetBeans doesn't support JDK 16. > UnsupportedClassVersionError - If I set the NetBeans Runtime to Java 16, I > cannot run a project created in Java 15. > --- > > Key: NETBEANS-5491 > URL: https://issues.apache.org/jira/browse/NETBEANS-5491 > Project: NetBeans > Issue Type: Bug > Components: java - Platform, java - Project, java - Source >Affects Versions: 12.3 > Environment: Windows 10, Apache NetBeans 12.3, Java 16 >Reporter: Michal Rama >Priority: Blocker > Labels: java, platform, project, runtime, version > Attachments: obr�zek02.png, obr�zek41.png > > > Hello, > I installed Java 16 and set it in the etc\netbeans.conf file > *netbeans_jdkhome="C:\Program Files\Java\jdk-16"* > However, upon startup, all projects reported an error. NetBeans automatically > set the *Java Platform* to *JDK 16* for them, but the *Source / Binary > Format* was still *JDK 15*. > !obr�zek41.png! > !obr�zek02.png! > So it was enough to change it to JDK 16, except for one project that still > can't be run and I didn't figure out why. > To run this project I need to close NetBeans and run it again in Java 15. > Creating a new project in Java 16 would probably solve the problem, but why > should I do it when there was no problem with all the other projects. > Please help. > Thank you -- This message was sent by Atlassian Jira (v8.3.4#803005) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists