Error Installing DevStyle plugin for Eclipse - java

I installed the current latest version of eclipse (202006) CDT. I have tried installing the DevStyle plugin and received the following error:
Cannot complete the install because some dependencies are not satisfiable
Software being installed: a.jre.javase 14.0.0
Software currently installed: C/C++ Autotools support 9.11.1.202004012023 (org.eclipse.cdt.autotools.feature.group 9.11.1.202004012023)
Cannot satisfy dependency:
From: C/C++ Autotools support 9.11.1.202004012023 (org.eclipse.cdt.autotools.feature.group 9.11.1.202004012023)
To: org.eclipse.equinox.p2.iu; org.eclipse.tools.templates.freemarker.java11 [1.1.100.202001140305,1.1.100.202001140305]
Cannot satisfy dependency:
From: Template Engine Freemarker Support (Java 11) 1.1.100.202001140305 (org.eclipse.tools.templates.freemarker.java11 1.1.100.202001140305)
To: osgi.ee; (&(osgi.ee=JavaSE)(version=11))
This error message is fairly cryptic to me. I looked a similar problem here. But this specifies Java 11 and Java 14. I don't know how this relates to my JRE 1.8.0_251 (Version 8 Update 251). I also don't understand the new scheme for Java. Does Oracle not release JRE's anymore?
I don't need to program in Java. I only need runtime environment to run eclipse, so I don't want/need full JDK (especially since this seems to require some licensing/commercial aspects). I also believe I will get similar errors with other plugins that I intend to install.
So two questions here:
Is there a way to get JRE's for Java 11 or Java 14?
What version of JRE/JDK do I need to get this to work?

It's actually a bug, Java 11 is not required for CDT 9.11. You can take a look here to use a workaround: cdt dev mailing list Java 11 problem

To: osgi.ee; (&(osgi.ee=JavaSE)(version=11))
This means that at least Java 11 is required by this code. It will not run with Java 8. You will have to move to a newer Java.
Newer versions of Java only have a JDK with no separate JRE. The Java builds on the OpenJDK site have a 'normal' free license and are essentially to same as the Oracle Java.

Related

Building JavaFX Projects with JDK 11.0.2 and Eclipse?

I've spent too much time trying to find how to do this with. Tips for setting up a dev environment are what I am asking for, however I will start with what I tried so far.
As I understand JavaFX was separated from the JDK after JDK 8, however, for an R&D project, I need to create JavaFX applications that can be built and compiled in Java 11. Normally installing the e(fx)clipse plugins into Eclipse will not work unless a Java 8 installation is pointed to.
So, I have been following this guide: https://gist.github.com/stevenliebregt/bc62a382fc43064136b662ee62172ab3
JavaFX 11 is on LTS from Gluon, it seems, meaning I'd have to pay at least $900 to get it.
So instead, I tried building OpenJFX using following the instructions at this link:
https://wiki.openjdk.org/display/OpenJFX/Building+OpenJFX
When I start the build with Gradle, it fails because the minimum supported version for Java to build this is apparently 17.
Any suggestions for building JavaFX projects with JDK 11 is greatly appreciated.
The LTS version is JavaFX 11.0.16. You can download non-LTS 11.x versions from GluonHQ by checking the "include older versions" checkbox on the download page.
Once you clicked it, you see all versions starting with 11 until 20-ea+1, even the obsolete ones.
Your best choice is probably 11.0.2
And to add something you didn't ask for: JDK 11 is compatible with the latest versions of JavaFX, even JavaFX 18, as you can see in the Release Notes:
"As of JDK 11 the JavaFX modules are delivered separately from the
JDK. These release notes cover the standalone JavaFX 18 release.
JavaFX 18 requires JDK 11 or later."
(I emphasized the last part of the quote)
Thanks all, for the good information. I found that the best way to handle this way to build in IntelliJ instead. I can build and run JavaFX 18 easily with JDK 11.

How to Use Java 8 settings to build project in eclipse 4.18(2020-12)

*Due to some project requirements I "have" to use eclipse 4.18 (2020-12) which uses Java 11 by default and is mandatory to start.
But my entire project is/was written in Java 1.7 earlier. Now , in my mac i have both java 1.8 and 11 installed also my eclipse settings are such shown below.
I have made sure removed all java 11 references in my eclipse and made the project and workspace configure to take the 1.8 jdk and run at 1.7 compiler level.*
but when i run ,project -->clean-->build, i run into the JaxB missing in java 11 ( in java 11 JAXB was removed and my project uses jaxB extensively) This is known.
So i am wondering what am i missing that my projects are still building my project with java 11 and not java 1.7 (using jdk 1.8 configured).
Please help.. stuck on this since some days.
machome
Eclipse Compiler setting-1
Eclipse Setting Execution Envs
Eclipse installed JRE's
Eclipse Project specific setting
Java 11 JaxB error
If Eclipse itself is being run with Java 11, and you have a plug-in installed that has not been properly update to work under Java 11, as it appears, you will need an updated version of that plug-in. Update to the latest "oracle design studio", and if you still see this problem, contact Oracle support.
The latest Eclipse may require Java 11 to run, but it's simple to set up Eclipse projects that use older Java versions. Don't mess with the Java version it uses to start up, as long as that is a proper Java 11 version.
As one commenter mentions, you'll have to have a particular Java distribution configured in "Installed JREs->Execution Environments", and then you'll have to have the project configured to use that Java version symbol, like "JavaSE-1.7".

How to use JFX/OpenFX with OpenJDK 8

Is there any javafx/OpenJFX dependency which can be used directly in the pom file so that it works with OpenJDK 8? Or any workaround (without installing anything) which works with OpenJDK 8?
I have gone through a lot of similar questions on SO, but the solution to use JFX/OpenFX with OpenJDK 8 is either to install the openjfx package in Ubuntu OR use Oracle JDK 8. Unfortunately I cannot do both. I am using OpenJDK 8 and need to use javafx/OpenJFX within my swing application. The OpenJDK does not contain jfxrt.jar in its ext folder (as in case of Oracle JDK 8), and the versions of OpenJFX start from Java 9/10. And on trying to compile I get
class file has wrong version 54.0, should be 52.0 which is expected as it is build with Java 10
Any leads would be really helpful. Thanks!
I have already gone through the below links
Why is JavaFX is not included in OpenJDK 8 on Ubuntu Wily (15.10)?
"class file has wrong version 54.0, should be 52.0" while trying to build JavaFX application
"class file has wrong version 54.0, should be 52.0" while compiling javaFX project
How to find out JavaFX version
Is there any javafx/OpenJFX dependency which can be used directly in the pom file so that it works with OpenJDK 8?
AFAIK, no. There are org.openjfx artifacts for OpenJFX 11 onwards, but they won't work with Java 8. (The class file version will be wrong.)
Or any workaround (without installing anything) which works with OpenJDK 8?
I think you will need to build your own copy of OpenJFX from source, and (touch wood) "package it" with your application1.
(The following is purely based on reading the OpenJFX build instructions. I have not tried this out.)
So if you want to build a stand-alone OpenJFX 8 for use with OpenJDK 8, then you should try the following build instructions on the OpenJFX wiki:
Building OpenJFX 8u
The result of the build is (apparently) a ZIP file that is designed to be "overlayed" onto a JRE installation.
You may be able to repackage that into JARs and native libraries that you can include in your application.
For OpenJFX 9 and later, the build instructions are here:
Building OpenJFX
Apparently, for N >= 9, OpenJFX version N is supposed to be supported for OpenJDK N and OpenJDK N - 1. So if that is accurate, you should be able to build OpenJFX 9 for OpenJDK 8. On the other hand, the build instructions talk about generating modules, and module support is only available in Java 9 and later. However it is still worth a try (IMO).
1 - Options include 1) creating a custom Debian package(s) (or RPMs) ... analogous to the existing Ubuntu packages, 2) incorporating the relevant classes and native libraries into your application JAR, or 3) adding them to your applications classpath and library load path. You may need to experiment.
Why don't you just use, e.g., https://bell-sw.com/pages/downloads/#/java-8-lts and download the full Java version (not standard). It should already contain JavaFX and is one of the many OpenJDK 8 versions floating arround.

JDK 1.8 not supported by vs code?

Does VS Code (code-runner extension) support JDK 1.8? In the morning I was using JDK 12 , but then I downgraded to JDK 1.8 to try out applet viewer and stuff. Unfortunately now it doesn't even highlight the code.
Someone please tell me the problem and its solution.
JDK 1.8 is supported by VSCode.
Read https://code.visualstudio.com/docs/languages/java and install needed extensions.
Update 2021
Currently to use the Java extension in VSCode its required JDK 11, but you can still use older versions of JDK in your projects. See this to get information about how to configure other JDK version for your project.
Java 1.8 was no longer supported since "Language support for Java" extension upgrade to 0.68.0, I downgraded to 0.64.1 which works for me.
As stated here:
Note: Although the Java language server requires JDK version 11 or above to run, this is NOT a requirement to your project's runtime.
This means that you need to have JDK 11 or higher installed. You can also install older JDKs and configure the runtimes. Just open the Command Palette (Ctrl+Shift+P) and type the command Java: Configure Java Runtime. If you have JDK 8 installed and have properly configured maven or gradle, this isn't even necessary. Visual Studio Code will correctly pick up the correct JDK.
VS Code no longer supports JDK 1.8. The "Java Extension Pack" relies upon "Language Support for Java(TM) by Red Hat" which documents Java 11 is the minimum requirement. See here: https://marketplace.visualstudio.com/items?itemName=redhat.java
Tis unfortunate, guess I'm switching back to eclipse

Fast-ClassPath-Scanner does not work with java 6 runtime?

Fast-ClassPath-Scanner
https://github.com/lukehutch/fast-classpath-scanner using latest version.
On executing(get names of all classes in war which includes all jars and classes)
new FastClasspathScanner(basePackage).scan().getNamesOfAllClasses()
getting:
unsupportedclassversion error with jre 6
Please provide a solution to it or alternative to perform same.
FastClasspathScanner is compiled for java 1.7
When you try to load it in a 1.6 (JRE6) environment it fails with an UnsupportedClassVersionError. This error indicates that the class version (here 1.7) is not compatible with the JVM version (here 1.6).
Java 7 is not backwards compatible with Java 6. You could try to build the FastClasspathScanner library yourself unter 1.6 (not sure if that's possible). Or upgrade your project to Java 7.
Correct, I am the author of FastClasspathScanner, and it's not a goal to get this working with JRE6. However, patches for supporting 1.6 are welcome.

Categories