I have javaFX project, with which i'm working on Eclipse IDE. This is Maven project with using of Spring.
My goal is to make runable jar file (dekstop application) from this project.
If i export my application to jar file like any other java project, then i recieve this on error:
C:\eclipse\projjars>java -jar EqMan.jar
Exception in thread "main" java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:276)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:122)
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:163)
at com.sun.javafx.application.LauncherImpl.access$000(LauncherImpl.java:47)
at com.sun.javafx.application.LauncherImpl$1.run(LauncherImpl.java:115)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: C:\eclipse\bin\glass.dll
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:143)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:56)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
at com.sun.glass.ui.Application$1.run(Application.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:85)
at com.sun.glass.ui.win.WinApplication.<clinit>(WinApplication.java:33)
at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:20)
at com.sun.glass.ui.win.WinPlatformFactory.createApplication(WinPlatformFactory.java:17)
at com.sun.glass.ui.Application.Run(Application.java:108)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:266)
... 5 more
If i'm trying to make jar file with javafxpackager, i recieve this one error:
C:\eclipse\workspace\equification>javafxpackager -makeall -appclass ru.igs.ava.equification.EquificationFX -name "Equification" -width 800 -height 600
warning: [options] bootstrap class path not set in conjunction with -source 1.5
C:\eclipse\workspace\equification\src\main\java\ru\igs\ava\equification\EqConfigureRole.java:5: error: package org.springframework.context does not exist
import org.springframework.context.ApplicationContext;
C:\eclipse\workspace\equification\src\test\java\ru\igs\ava\equification\AppTest.java:11: error: cannot find symbol
extends TestCase
^
//and the same error for every class, which is added to my project as maven dependency.
So, how can i make runable jar file without converting my project to NetBeans project?
Seeing as you are using Maven for your builds, you can also use Maven to initiate the JavaFX packaging. To do this use the Maven antrun plugin to invoke the JavaFX ant tasks to generate a jar for your application with an embedded JavaFX launcher. Here is a sample maven pom to do this.
Your errors in running the javafx packager are due to not appropriately setting the classpath for the packager. An example of how to set the classpath for the javafx packager to package an application which relies on dependent lib jars is in this build script.
The unsatisfied link errors are because you are not including the required lib dll's in a ../bin directory relative to the runtime location of jfxrt.jar when you run your app. You also might not be correctly packaging your application with a JavaFX launcher (via executing the recommended javafx ant tasks or javafxpackager commands to generate your JavaFX application jar).
Update
For Maven based builds of JavaFX applications, you can now use a Maven JavaFX plugin.
Going from the suspicion that the underlying problem is due to an incompatibility between jfxrt.jar and the version of Java installed worked for me. The jfxrt.jar the application was using was compatible with jdk-7u71, yet the application was on a machine where JAVA_HOME was set to 7.0.05. So I installed jdk-7u71 on the problem machine and updated JAVA_HOME.
Related
I have an Epson TM-T88V printer and want to print a receipt with my own java code using eclipse. Have done the installation of javapos adk for Linux, set the /opt/EpsonJavaPos/bin to /root/.bash_profile, and of course java. Installed the tmt-cups driver as well and set up the printer using the PPD file. But after all these setups, I am getting the below error every time while trying to run my java code using eclipse. All the required javapos jars are present in jre/lib/ext folder and even set the native JNI library from /opt/EpsonJavaPos/bin to my java code using eclipse. Used SetupPOS to get the jpos.xml and dumped into the eclipse as well. Used check health test and getting the same below error as from eclipse while running my code-:
jpos.JposException: Failed to load the JNI.
at jp.co.epson.upos.T88V.pntr.T88VService.initializeUsingCommand(Unknown Source)
at jp.co.epson.upos.core.v1_13_0001.pntr.CommonPrinterService.open(Unknown Source)
at jpos.BaseJposControl.open(Unknown Source)
at Step1Frame.processWindowEvent(Step1Frame.java:81)
at java.awt.Window.processEvent(Window.java:2009)
at java.awt.Component.dispatchEventImpl(Component.java:4872)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Window.dispatchEventImpl(Window.java:2719)
at java.awt.Component.dispatchEvent(Component.java:4698)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:720)
at java.awt.EventQueue$4.run(EventQueue.java:718)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
I am stuck here for a long time and have no clue. Any help will be very appreciated.
Finally error gone after adding the following lines to ~/.profile and ~/.bashrc.
LD_LIBRARY_PATH=/opt/EpsonJavaPOS/bin:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH
I just installed Android Studio 3.1.4 on Windows 10, and upon creating an empty test project, and building it, I'm getting the error:
Cannot find JAR 'aws-java-sdk-kms-1.11.6.jar' required by module 'gradle-resources-s3' using classpath or distribution directory
It is referencing gradle 4.4 in my documents\.gradle folder. Anyone has any idea how to go about this problem?
This turned out to be a blockage for an internet security suite. The suite scans all incoming jar dependencies while they are extracted from the global gradle zip file. For some reason, a select few packages are flagged, and thus gradle syncing fails.
I am building a gradle plugin in Groovy using Eclipse Neon 3. I have linked the internal dependencies as below, and have generated an Eclipse configuration using the Eclipse gradle plugin.
dependencies {
compile gradleApi()
compile localGroovy()}
I have specified that I would like to download and receive source code and Javadoc for dependencies:
eclipse {
classpath {
downloadSources = true
downloadJavadoc = true
}}
For all dependencies but the internal ones, this works. I am not receiving source code or javadoc api for the following:
gradle-api-3.5.jar
groovy-all-2.4.10.jar
gradle-installation-beacon-3.5.jar
gradle-test-kit-3.5.jar
Given that these are very important to understand the framework,
my question is:
How do I configure a groovy-based gradle plugin project in Eclipse, such that the above four libraries have JavaDoc and Source navigation available?
I just added the newest SDK of Apache Flex (4.12.1), as3corelib, OSMF and playerglobal14_0 to my library and and setup a simple Flash "Hello World"-project (default). The code inspection shows no errors whatsoever.
I am working with IntelliJ IDEA 13.1.3 on Ubuntu 14.04 LTS
However, compiling with the built-in shell fails with
Error:[TestFlex]: java.net.SocketTimeoutException: Accept timed out
Error:[TestFlex]: Exception in thread "main"
Error:[TestFlex]: java.lang.NoClassDefFoundError: flex2/tools/VersionInfo
at com.intellij.flex.compiler.FlexCompiler.<clinit>(FlexCompiler.java:19)
Caused by: java.lang.ClassNotFoundException: flex2.tools.VersionInfo
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 1 more
Compiling with Mxml/compc fails with
Error:[TestFlex]: Could not find or load main class flex2.tools.Mxmlc
Any ideas?
I can give you some information about where to start looking for the problem, which is possibly an incomplete installation of the SDK on your system.
Both of the missing classes you mention are in mxmlc.jar, and IntelliJ IDEA expects to find mxmlc.jar in the sdk/lib folder. If mxmlc.jar is missing, you would see this error:
java.lang.NoClassDefFoundError: flex2/tools/VersionInfo
Using the Apache Flex SDK Installer, you can be assured of a complete copy of the SDK:
http://flex.apache.org/installer.html
IntelliJ IDEA looks in the Flex/AIR SDK home path you have specified under Platform Settings-->SDKs in your Project Structure. The Project Structure UI is under the File menu in IntelliJ IDEA.
IntelliJ documentation site regarding project SDKs:
https://www.jetbrains.com/idea/help/configuring-global-project-and-module-sdks.html
I just encountered the same error, when trying to compile with
AIR 16 Beta in this configuration:
IDEA 14 64 Bit
apache Flex 4.13
AIR 16 Beta.
Windows 7, 64 Bit
AIR 15
I had different problems with AIR15; most probably a heap size issue that I could not fix yet.
The error is:
Failed to package AIR application xxxxx.ipa:
Undefined symbols for architecture armv7
AIR 14
No problems with AIR 14 (same Flex and IDEA version)
Any idea??
I'm having an issue with a custom hook I'm deploying in Liferay.
I've created both a hook and a theme using Liferay Plugins SDK 6.2.0
I create a .war (with Eclipse's built in Liferay -> SDK -> war command) for my theme, and deploy it onto my server running Liferay EE 6.2, which works fine.
However, I repeat the same process with my hook and I get this error:
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.UnsupportedClassVersionError: com/bofa/UserLoginImpl :
Unsupported major.minor version 51.0 (unable to load class com.bofa.UserLoginImpl)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassL
oader.java:2908)
I'm not sure if this could be a Java Compiler version error like I've read about, because my theme uses the same exact settings and works properly.
Any ideas?
Its because of different JDK at compile time and runtime, make sure you are using same JDK version to compile and run it.
It generally occurs if a higher JDK version is used to compile the java file and a lower JDK version is used at runtime