-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Cannot open Java sources if NetBeans 12.6 is run on JDK 8 #178
Comments
Please note that 1.14.0 version of the plugin works fine in Apache NetBeans 11.3 running on JDK 1.8.0 Update 271. |
Hello @jkovalsky, I tried to compile against JDK 1.8, but unfortunately I'm using past JDK 1.8 features like Lambdas and Streams and so on in my source code, so I think there is no turning back to Java 1.8 for me here. Kind regards, |
@jkovalsky So the question is still: Can I get the verification even when my plugin is compiled with Java 11 or is there no chance? In earlier NetBeans plugin development (with Ant instead of Maven) it was possible to add "Required Tokens" to e.g. exclude plugins from Windows, Linux or macOS or if another plugin is not installed which provides a specific token. Do you know if that's still possible and if there is a token for the JDK version which is used to run NetBeans? So I could hide the plugin from NetBeans instances running below Java 11. Would this be an option? Also would it be ok for you if I ask in the NetBeans dev mailing list for advice? Kind regards, |
@funfried thanks for your reply and investigation. You can of course ask for help via dev@netbeans.apache.org mailing list but maybe you just want to copy the same solution which is used in the 1.14.0 version of your plugin which works fine also in 12.6. Unfortunately, 1.14.1 version is also broken and makes NetBeans Java Editor unusable. Until this is sorted out I would recommend requesting verification of 1.14.0 version for NetBeans 12.6 users. |
Hmm, I think there is a misunderstanding here. And 1.14.0 is only working because it is using an older version of the Eclipse formatter which was compiled with Java 1.8, but they switched from Java 8 to 11, so I did the same which seemed legit to me as Java 8 is quite old now and Java 11 was the latest LTS release when I was switching. But nevertheless, as said, my latest dependencies (I think not just Eclipse formatter also the Google formatter) are using Java 11 and I cannot stay with older versions as you can imaging. |
Yes, the 1.14.1 plugin works fine in NetBeans 12.6 running on JDK 11 of course. So there are two options:
In both cases I am willing to revisit my NoGo decision and approve it for publishing on the Plugin Portal Update Center. |
Added a module installer to the plugin, so NetBeans will try to call the plugin when starting up and fail to call the installer if NetBeans runs below Java 11, otherwise it would cause issues in the editor during runtime when NetBeans is running with Java 8 instead of Java 11 (which is required by this plugin and its dependencies)
Thanks! First solution sounds perfect to me, I just found out that a Module Installer shows that the plugin won't work on NetBeans running with Java 8 when the plugin should get activated, so that should be fine I guess. Unfortunately, Travis is not running my pipelines anymore as I'm using a free plan and it seems I exceeded my free credits there, so I cannot deploy any versions to Maven Central or GitHub at the moment as Travis is usually responsible for that in my release workflow. I have to switch to GitHub Actions for that first and will then come back to you. Kind regards, |
FYI, I have just learned that the preferred way how to do it is much easier. See here. |
Looks a lot better, thanks! I'll try it and let you know when I have a new version published. It seems I've also migrated my release pipeline to GitHub Actions successfully, so it shouldn't take very long, maybe today evening or tomorrow. |
Hi @jkovalsky, Finally I got everything together (better than before) and here is the fixed version as a pre-release: 1.14.3-SNAPSHOT Thanks in advance. Cheers, |
I am sorry but I cannot access the file. Can you fix it or share the NBM elsewhere? |
Hi @jkovalsky, I hope it's working this time 🤞 |
Just a follower, but I was able to download it from Packages (it is about midway down on the list on the right). I can confirm that it worked on JDK17, NB12.6, (MacOSX, M1 Pro, Monterey). Thanks for working through this. I realize the real test is the behavior for JDK 1.8, which I cannot test. |
@dgreen I need the confirmation for Java 1.8, but thanks for checking as well! |
Thanks for the packages link. Unfortunately, after successful installation of the plugin in Apache NetBeans 12.6 running on 1.8.0_271 I keep getting the following exception and the problem persists. The plugin UI such as External Formatter options category is empty, user cannot open project properties, navigator never loads and Java files complain about missing mime type. |
@jkovalsky That's really weird, as for me there is an error when starting the NetBeans IDE with Java 1.8 (running my project from within NetBeans) that I have to disable the plugin as it won't work with Java 1.8, only with Java 11. I'll do some more research on my system and try to reproduce this issue. Thanks again for trying it out and for the feedback. |
Hello @jkovalsky, Finally I had some time to test it myself with Java 1.8 and NetBeans 12.5 and I got this when I tried to install the plugin: I wonder why this message wasn't shown for you as well. Maybe you've got an old SNAPSHOT by accident, could you please try once more with this NBM file? Sorry for the whole back and forth, I hope this is solving the issue now. Cheers, |
Hey Fabian, please accept my apologies! Your assumption was right as I downloaded wrong file (externalcodeformatter-1.14.3-20220104.225539-1.nbm). With externalcodeformatter-1.14.3-20220112.231113-6.nbm everything works great and I cannot install your plugin with JDK 1.8 while with JDK 11 it works fine. You are good to go! |
Perfect, thanks again for pre-testing! I'm just really happy that it works now. |
I tried to install 1.14.2 version of External Java Code Formatters plugin to my Apache NetBeans IDE 12.6 running on JDK 1.8.0 Update 271 but it resulted in unusable Editor. Opening any Java file resulted in empty editor due to attached UCVError.txt. Please see the attached file. Can you please compile the plugin with older JDK?
The text was updated successfully, but these errors were encountered: