JavaFX 2 Linux Exception - java

Worked on a JavaFX 2 application and while testing on linux i got:
:/tmp$ /opt/Oracle_Java/jdk1.7.0_13/bin/java -jar MyAdessoNotificationTool.jar
java.lang.UnsatisfiedLinkError: com.sun.glass.ui.gtk.GtkTimer._startImpl(Ljava/lang/Runnable;I)J
at com.sun.glass.ui.gtk.GtkTimer._startImpl(Native Method)
at com.sun.glass.ui.gtk.GtkTimer._start(GtkTimer.java:24)
at com.sun.glass.ui.Timer.start(Timer.java:69)
at com.sun.javafx.tk.quantum.QuantumToolkit.finishLaunching(QuantumToolkit.java:366)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:89)
at java.lang.Thread.run(Thread.java:722)
any ideas what it is?
greetings
Kaito

Related

error running javafx application with Intellij

I have a javafx program that I was formerly developing in sublime text before migrating to intellij as my editing environment. As of now, I can compile and run without error through the command line (Windows). However, when I try to run it from intellij, I get the following message:
Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:875)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$147(LauncherImpl.java:157)
at com.sun.javafx.application.LauncherImpl$$Lambda$1/868693306.run(Unknown Source)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException: Location is required.
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3201)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3169)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3142)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3118)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3098)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:3091)
at Main.setNewScene(Main.java:40)
at Main.start(Main.java:29)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$153(LauncherImpl.java:821)
at com.sun.javafx.application.LauncherImpl$$Lambda$50/2069914884.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$166(PlatformImpl.java:323)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/646648017.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$164(PlatformImpl.java:292)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/1106256089.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$165(PlatformImpl.java:291)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/151108218.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$141(WinApplication.java:102)
at com.sun.glass.ui.win.WinApplication$$Lambda$38/2004449016.run(Unknown Source)
... 1 more
Process finished with exit code 1
I don't know how to fix this.
The problem turned out to be intellij having an issue with the source folder in the project directory. By moving all my java files to a new directory and reopening it in intellij as a new project with a single, correct source folder, the problem completely went away.
(As stated in the question, the code itself was functional and worked through the command line.)

Running JavaFX 2 on Mac with Java 6?

I'm developing a Java Swing application using some features of JavaFX 2(such as WebBrowser).
I tried to reference the jfxrt.jar file from inside my folders, since it seems that a javaFX2 installer for MAC is not available (only installing Java 7).
But I would like to use JavaFX 2 also with Java 6.
I get this error:
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.lang.NoSuchMethodError: getScaleFactor
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(Unknown Source)
at com.sun.javafx.application.PlatformImpl.startup(Unknown Source)
at javafx.embed.swing.JFXPanel.initFx(Unknown Source)
at javafx.embed.swing.JFXPanel.<init>(Unknown Source)
at javabrowser.JpJavaBrowser.initComponentsFx(JpJavaBrowser.java:63)
at javabrowser.JpJavaBrowser.<init>(JpJavaBrowser.java:59)
at orderbook.FrOrderBook.initComponents(FrOrderBook.java:625)
at orderbook.FrOrderBook.<init>(FrOrderBook.java:179)
at orderbook.FrOrderBook$2.run(FrOrderBook.java:681)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)
at java.awt.EventQueue.access$400(EventQueue.java:82)
at java.awt.EventQueue$2.run(EventQueue.java:676)
at java.awt.EventQueue$2.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
...
Caused by: java.lang.NoSuchMethodError: getScaleFactor
at com.sun.glass.ui.mac.MacApplication._initIDs(Native Method)
at com.sun.glass.ui.mac.MacApplication.<clinit>(Unknown Source)
at com.sun.glass.ui.mac.MacPlatformFactory.createApplication(Unknown Source)
at com.sun.glass.ui.Application.Run(Unknown Source)
... 23 more
How can I fix this?
JavaFX 2 does not support Java6 on OS-X - Java6 is only supported on win32

NPE caused by Modena.class.getResource("TestApp.css")

I'm trying to run the java-fx sample Modena that can be found here. I use Netbeans 8.0 Beta, JDK8 last release on Windows 8. I wonder why I can't even compile it.
In fact the first exception that happens is this.
I note to be a newbie in JavaFX.
The line of exception in the program is:
private static final String testAppCssUrl = Modena.class.getResource("TestApp.css").toExternalForm();
I assert that I verified and the file existed. And the example jar file can be run on my computer with my Java default configuration which is explained above.
Exception in thread "JavaFX Application Thread" Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:340)
at com.sun.javafx.application.LauncherImpl$2.run(LauncherImpl.java:330) at com.sun.javafx.application.LauncherImpl$2.run(LauncherImpl.java:330)
at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:331) at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:331)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:297)
at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:294)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.NullPointerException
at modena.Modena.<clinit>(Modena.java:100)
... 13 more
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:767)
Caused by: java.lang.NullPointerException
at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:362)
at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:305)
... 5 more
The problem was with running only the main file with Shift+F6. I should have used F6 to run the project instead. F6 runs the project but Shift+F6 only runs the file containing the static main method without considering the project configuration.

Error while running advanced MTShell in MT4J

I have problem running MT4J examples. I try running he advance MTShell and I get the following errors.
Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: C:\Users\Umar\Downloads\mt4j-desktop\jogl.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1957)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1882)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1872)
at java.lang.Runtime.loadLibrary0(Runtime.java:849)
at java.lang.System.loadLibrary(System.java:1087)
at com.sun.opengl.impl.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:189)
at com.sun.opengl.impl.NativeLibLoader.access$000(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader$DefaultAction.loadLibrary(NativeLibLoader.java:80)
at com.sun.opengl.impl.NativeLibLoader.loadLibrary(NativeLibLoader.java:103)
at com.sun.opengl.impl.NativeLibLoader.access$200(NativeLibLoader.java:49)
at com.sun.opengl.impl.NativeLibLoader$1.run(NativeLibLoader.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.opengl.impl.NativeLibLoader.loadCore(NativeLibLoader.java:109)
at com.sun.opengl.impl.windows.WindowsGLDrawableFactory.(WindowsGLDrawableFactory.java:60)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at javax.media.opengl.GLDrawableFactory.getFactory(GLDrawableFactory.java:106)
at org.mt4j.util.opengl.CustomPGraphicsOpenGL.allocate(CustomPGraphicsOpenGL.java:73)
at processing.core.PGraphics3D.setSize(PGraphics3D.java:326)
at processing.core.PApplet.makeGraphics(PApplet.java:1325)
at processing.core.PApplet.size(PApplet.java:1146)
at processing.core.PApplet.size(PApplet.java:1106)
at org.mt4j.MTApplication.setup(MTApplication.java:210)
at processing.core.PApplet.handleDraw(PApplet.java:1580)
at processing.core.PApplet.run(PApplet.java:1502)
at java.lang.Thread.run(Thread.java:724)
Your libraries aren't correctly linked. I answered this exact question in another post:
Error while running MT4J

Netbeans Emulator doesn't start

When I run mobile application in netbeans 6.9.1 it shows me below error in output window.
it doesn't allow me to start emulator.
java.lang.UnsatisfiedLinkError: /home/devindia/netbeans-6.9.1/mobility/WTK2.5.2/bin/sublime.so: /home/devindia/netbeans-6.9.1/mobility/WTK2.5.2/bin/sublime.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1750)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1646)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)
at com.sun.kvem.Sublime.<init>(Unknown Source)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.sun.kvem.Lime.createLime(Unknown Source)
at com.sun.kvem.KVMBridge.<init>(Unknown Source)
at com.sun.kvem.KVMBridge.getBridge(Unknown Source)
at com.sun.kvem.midp.MIDP.run(Unknown Source)
at com.sun.kvem.environment.EmulatorInvoker.runEmulatorImpl(Unknown Source)
at com.sun.kvem.environment.EmulatorInvoker.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at com.sun.kvem.environment.JVM.main(Unknown Source)
/home/devindia/NetBeansProjects/MobileApplication1/nbproject/build-impl.xml:898: Execution failed with error code 1.
BUILD FAILED (total time: 8 seconds)
I use ubuntu 10.4. 64 bit machine.
Looks like there is no way to run mobile emulator on x64-jdk (in linux), so you additionaly need to install x32-jdk to compile and run your ME-projects with it.
Usually this error means a mismatch in the java runtime. Are you running your code in 64 bit java runtime. ( I guess you downloaded Netbeans for 64bit linux)

Categories

Resources