webView is not working in openjfx 12 from eclipse maven project - javafx-8

I've used Java 8 to create JavaFX venture in which I utilized webview for HTML substance and it is JavaFX expert task. When I try to move to OpenJDK 12 from Java 8 it stops working. What's more, it returns the underneath blunder:
Exception in thread "JavaFX Application Thread"
java.lang.IllegalAccessError: superclass access check failed: class
com.sun.javafx.sg.prism.web.NGWebView (in unnamed module #0x2145b572)
cannot access class com.sun.javafx.sg.prism.NGGroup (in module
javafx.graphics) because module javafx.graphics does not export
com.sun.javafx.sg.prism to unnamed module #0x2145b572

Use this to VM arguments to load all libraries and it will work.
-Djava.library.path=ext\windows64 --module-path "C:\Program Files\Java\javafx-sdk-12.0.1\lib" --add-modules javafx.controls,javafx.fxml,javafx.web,javafx.graphics,javafx.media

Related

ClassCastException when sbt sync, getting class java.lang.UnsupportedOperationException cannot be cast to class xsbti.FullReload

I recently upgraded to the m1 mac. And am trying to set up my scala environment for a project. However, I'm getting this error when I'm trying to get my sbt to sync.
[error] [launcher] error during sbt launcher: java.lang.ClassCastException: class java.lang.UnsupportedOperationException cannot be cast to class xsbti.FullReload (java.lang.UnsupportedOperationException is in module java.base of loader 'bootstrap'; xsbti.FullReload is in unnamed module of loader 'app')
I was on corretto at first. But then I read somewhere and downloaded temurin via installing through sdk using
sdk install java
sdk install sbt
After installing it, I'm able to run sbt on the project in my terminal. However, within Intellij (even after changing the java sdk to temurin). I'm still getting that error.
The solution that I came upon to fix this was by using the right Java sdk. Using Corretto wasn't working, so I used sdkman to download java sdk instead. It downloaded Java Temurin, and i then changed to use Temurin. It worked after.

Build error deploying javafx application when added jna 4.1.0 library

I am trying to build my app, but I have the next error.
The jar libs\jna-4.1.0.jar has a main class com.sun.jna.Native that does not match the declared main com.bp.ocr.MainApp
I do not know how to solve it, I am looking for but I am not understand why happens.
Using base JDK at: C:\Program Files\Java\jdk1.8.0_31\jre
The jar libs\jna-4.1.0.jar has a main class com.sun.jna.Native that
does not match the declared main com.bp.ocr.MainApp
Bundler EXE Installer skipped because of a configuration problem:
Main application jar is missing.
Advice to fix: Make sure to use fx:jar task to create main application jar.
BUILD SUCCESSFUL

How to compile GWT project programmatically from a Java Application?

I need to compile a GWT project from Java App.
So i created a Compiler instance with CompilerOptions which sets output directories etc.
My code is like this:
Compiler compiler=new Compiler(new CompilerOptions() {......
....
}
ModuleDef def=new ModuleDef("sampleweb");
def.clear();
def.addSourcePackage("D:\\projects\\sampleweb\\src\\com\\sample\\web", new String[]{"client"}, new String[]{}, new String[]{}, true, false);
def.addGwtXmlFile(new File("D:\\projects\\sampleweb\\src\\com\\sampleweb\\web\\Sampleweb.gwt.xml"));
TreeLogger logger=new SwingTreeLogger(new SwingLoggerPanel(Type.ALL, new File("x.txt")));
compiler.run(logger,def);
When the compiler.run is called, a NullPointerException as shown is thrown
Exception in thread "main" java.lang.NullPointerException
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:373)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:246)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:141)
at com.google.gwt.dev.Compiler.run(Compiler.java:232)
at com.asklepian.TestApp.Starter.main(Starter.java:400)
How should I configure compiler?
I would create just the Java source code and the XML module code, and than execute a Java process who calls the GWT compiler. The GWT compiler is located at com.google.gwt.dev.Compiler, and you can execute it in Windows from the DOS command shell with the java command. The only parameter the compiler needs is the GWT module Location (the location of the module xml file).

Eclipse changed JRE for a project

I changed the JRE for a project in eclipse (Sun to JRockit). But when I try to run a class with main method I get a pop-up error message "Could not find main class. Program will exit" and "Exception in thread "Main Thread" java.lang.NoClassDefFoundError: Jrockit1/5" in the console. I can see that the project got rebuilt (timestamp of class files). What else do I need to change? All of this is for JRE 1.5
When you look at the Run configuration, does it use Sun or JRockit JVM. If you created your project before, it could have been set to the Sun JVM; which maybe cannot find some JRockit-specific classes.

Eclipse VM Argument and external JAR file error

I just added "-Djava.library.path=" to the "VM Arguments" under Run Configuration in Eclipse and everything works fine until I tried to add an external JAR file. I get the following error:
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path
Am I not setting something properly in Eclipse?
If your interested I forked RXTXserial a while back since thier update "schedule" sucks. I have just ported it over to the Android platform too. We decided to move the native libs into the jar and use reflection to deploy them. The API is the same as RXTX, but everything just works. You can find jars and full project sources at:
http://code.google.com/p/nrjavaserial/
The exception indicates that the class gnu.io.RXTXCommDriver tries to load a native library, which would be named rxtxSerial.dll on Windows and rxtxSerial.so on Linux, and the JVM cannot find it in the directories listed in java.library.path. Have you tried to add a JAR containing the library to java.library.path? I don't think that's possible, it has to be a directory containing the extracted library file.
Appearently that external library has a dependancy with another class gnu.io.RXTXCommDriver
. Perhaps you will need to add that library to class path.