Build path issue in Java 9 module development - java

I'm facing a trivial issue. I have changed the Java version to 9 (installed Java 11) on a java project.
Getting an error The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files
I understand this is build path issue and tried changing the java compiler to Java11 and it works fine but when this is changed back to Java9, the issue pops up.
Any help is highly appreciated. Thanks!

Related

IntelliJ Cannot start under Java 1.8.0: Java 11 or later is required

I had some problems with JRE versions, so I tried to change it using the plugin Choose Runtime. I changed it to Java 1.8.0_112-release-287-b2. Now, when trying to start IntelliJ, i get an unsupported Java version error: Cannot start under Java 1.8.0_112-release-287-b2: Java 11 or later is required. I have tried to modify the runtime path in the ide64.exe.jdk file, but it seems like the old jdk IntelliJ ran on has been deleted. I also tried reinstalling intellij, no luck either. Anyone know how to get back the JDK? do I just download it from oracle and install it in the IdeaIC2020.3\jdks\ folder?
Thanks,
Jakob
I went to the jdks folder and deleted all contents. This fixed the issue. IntelliJ started without a problem.

Eclipse 2020-06 - Error The project was not built since its build path is incomplete

I have already read a lot about this error but I can't fix it on my eclipse 2020-06
I installed ide for web and javascript developers and jdk 11.
I did some changes to my projects in order to migrate them from java 1.8 to java 11.
I have only some errors to fix.
The first is:
The project was not built since its build path is incomplete. Cannot find the class file for javax.xml.rpc.Stub. Fix the build path then try building this project.
The second is:
The type javax.xml.rpc.Stub cannot be resolved. It is indirectly referenced from required .class files...
They are related, so I think the problem is the same.
I read that lib has been removed in java 11.
I tried all solutions online but I can't fix it.
Can anyone help me please?
Thanks
EDIT: I added lib tab as required:

Using JavaFX13 with Java 13/8 and have JNI error?

Error: A JNI error has occurred, please check your installation and try again.
Eclipse states: test has been compiled by a more recent version of the Java Runtime (class file version 56.0), this version of the Java Runtime only recognizes class file versions up to 52.0.
I had the problem referenced at this question: "Could not find or load main class" while trying to use JavaFX in Eclipse When using JDK13 and JavaFX13. All solutions pointed to downgrading to Java 8.
I installed Java 8, updated the build path, and it built fine. But now I get the error I am using Eclipse 2019-06 (4.12.0), JavaFX13, and JDK 1.8.0_231.
I researched the answer but the two questions that come didn't help. One was for an IntellJ solution and the other had a package I am unfamiliar with, and the error had to do with that package.
I simply don't know how to correct the build path or dependencies to fix this issue. It appears I need a lower version of the JVM, but cannot seem to locate it. Am I right, or can you please help?
Well, I have dropped back to JDK 8 and the built in JavaFX. Despite my best efforts, I cannot get JDK13 and JavaFX 13 to work without receiving the error "Could not find or load main class" (see link in post). Since there is no solution to that problem yet that works for me, I can bypass my error on this request all together and just use much older packages.

Intellij IDEA 2018.2 does not recognize the JavaFX packages with JDK 10

I have searched but not found any detailed information about it. In http://www.oracle.com/technetwork/java/javafx/downloads/index.html it says
As of JDK 7u6 JavaFX is included with the standard JDK and JRE bundles
But I am getting error on compile the code includes javafx.* packages. The packages are not founding. I am using Oracle JDK 10.0.2 and Intellij Idea 2018.2. Code is worked after I added the $JAVA8_HOME/jre/lib/ext/jfxrt.jar as library.
But the strange thing is I am able to build the code to target bytecode version 8 without adding the jar file from JDK 8 as above.
So the question is
How can I get the latest JavaFX?
Is the latest JavaFX is in the JDK 8?
UPDATE
JDK 10 includes JavaFX and compiled and ran successfully in command line. There is a problem with Intellij IDEA 2018.2. It does not recognize the JavaFX packages.
The error message in Intellij:
Error:(3, 26) java: package javafx.application does not exist
Note: There is no error while coding in editor (Not underling red). Error occurs when compiling in Intellij.
Updated question title.
JavaFX is included in Oracle JDK up to and including Java 10. From Java 11 onwards it will not be included anymore but can be downloaded separately here http://jdk.java.net/openjfx/ .
Additional information on how to get started with JavaFX from version 11 onwards is also available here: http://docs.gluonhq.com/javafx11/ .
Problem solved with this step:
Set the Project byte code version to 10 instead of 8 in
File > Settings > Build, Execution, Deployment > Compiler > Java Compiler
Thanks for helps.

Issues going from grails 1.0.x to 1.1.2

I have a code taht I am working on that was last worked on some time ago. It was an earlier version of grails (but I am not sure which) and I had to run the grails-upgrade command for it.
Now when I do grails run-app, i get the following:
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, General error during semantic analysis: unable to locate the java compiler com.sun.tools.javac.Main, please change your classloader settings
What does this mean exactly, and how do I fix it? Is it actually a groovy problem? I googled the error message but didnt find much.
Thanks#
The problem was the Java version, and not groovy. The original code was written and compiled with 1.5. I switched the JDK from 1.6 to 1.5 and it worked.

Categories

Resources