Issues with screen capture using com sun JNA : undefined symbol: GetDesktopWindow - java

I am working on a site where I have to build a module to capture the web screen on click event. I referred few posts in SO and I tried using Robot (java.awt.Robot) and JNA (com.sun.jna.*) and both the cases I was successful when I tried from my local machine or a local tomcat server. It did capture the web page and I am using Java 1.7
When I deployed the code in my Ubuntu (Ubuntu 14.04.4), I started having challenges in both the cases.
With JNA, I keep getting the exception as mentioned below. FYI, I have mentioned the versions of Java that I am using in Ubuntu. I am sure this is something to do with configuration or I am not sure if my Java version is not picked properly by the system. Any guidance will be helpful. I referred through the internet but didnt find any guidance to solve this issue
The Java version I am using is javac 1.7.0_131 ( java-7-openjdk-amd64)
java.lang.UnsatisfiedLinkError: Error looking up function 'GetDesktopWindow': /usr/lib/jvm/default-java/bin/java: undefined symbol: GetDesktopWindow
at com.sun.jna.Function.<init>(Function.java:212) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:541) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:518) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:504) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.sun.jna.Library$Handler.invoke(Library.java:220) ~[jna-4.2.2.jar:4.2.2 (b0)]
at com.boot.service.$Proxy118.GetDesktopWindow(Unknown Source) ~[na:na]
at com.boot.service.AuditService.getScreenshot(AuditService.java:133) ~[AuditService.class:na]
at com.boot.service.AuditService.captureScreen(AuditService.java:118) ~[AuditService.class:na]
at com.boot.service.AuditService.captureScreenshotAndStore(AuditService.java:66) ~[AuditService.class:na]
at com.boot.controller.AuditController.captureScreenshotAndStore(AuditController.java:38) ~[AuditController.class:na]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_131]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_131]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) ~[spring-web-4.3.3.RELEASE.jar:4.3.3.RELEASE]
When I list my JVM folder, these are the different version of Java I see,
default-java java-1.7.0-openjdk-amd64 java-7-openjdk-amd64 java-7-oracle java-8-oracle
With Robot, it worked good in my local but failed in Ubuntu with the following error.
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11.XToolkit
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_131]
at java.lang.Class.forName(Class.java:195) ~[na:1.7.0_131]
at java.awt.Toolkit$2.run(Toolkit.java:869) ~[na:1.7.0_131]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_131]
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:861) ~[na:1.7.0_131]
I referred few posts which asked to update the headless variable to true. I am using Spring boot and not sure how to set that but I did System.setProperty("java.awt.headless", "false"); as part of the service constructor. It didnt help either

The GetDesktopWindow function is part of the Microsoft Windows API. Running it on a Linux environment won't work. I believe it works on your machine because your PC is a Microsoft Windows OS.
There is an OS independent solution, here on SO that accomplishes your requirements.

Related

When running the JNPL application ASDM, Loading freezes at 17 %. What may be the problem

I have been trying to run ciscoASDM. After I run the command javaws startup.jnlp and app opens. After login, it goes freeze at 17%. What may be the problem?
I have java
java-1.11.0-openjdk-amd64 1111 /usr/lib/jvm/java-1.11.0-openjdk-amd64
java-1.16.0-openjdk-amd64 1611 /usr/lib/jvm/java-1.16.0-openjdk-amd64
java-1.8.0-openjdk-amd64 1081 /usr/lib/jvm/java-1.8.0-openjdk-amd64
$ javaws startup.jnlp
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
selected jre: /usr/lib/jvm/java-8-openjdk-amd64/jre
Unable to use Firefox's proxy settings. Using "DIRECT" as proxy type.
Codebase matches codebase manifest attribute, and application is signed. Continuing. See: http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/no_redeploy.html for details.
Starting application [com.cisco.launcher.Launcher] ...
asdm.runStartupWizard = true
java.lang.ClassNotFoundException: com.sun.deploy.trace.Trace
at net.sourceforge.jnlp.runtime.JNLPClassLoader.loadClass(JNLPClassLoader.java:1640)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.cisco.launcher.i.a(Unknown Source)
at com.cisco.launcher.i.if(Unknown Source)
at com.cisco.launcher.i.a(Unknown Source)
at com.cisco.launcher.s.if(Unknown Source)
at com.cisco.launcher.Launcher.main(Unknown Source)
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:498)
at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:576)
at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:945)
According to this Github issue, Cisco ASDM does not work with OpenJDK 8 because deploy.jar file is missing.

Trouble with JDK on Mac OS X

I have Mac OS X 10.13.6. Previously I had the official JDK 8 installed which used to work fine but recently I switched to the Homebrew version and also upgraded to JDK 10. This has suddenly broken my java setup. Now when I try to launch Webstorm I get the following error:
com.intellij.ide.plugins.PluginManager$StartupAbortedException: java.lang.reflect.InvocationTargetException
at com.intellij.ide.plugins.PluginManager.a(PluginManager.java:78)
at java.lang.Thread.run(Thread.java:745)
Caused by: 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:498)
at com.intellij.ide.plugins.PluginManager.a(PluginManager.java:75)
... 1 more
Caused by: java.lang.UnsatisfiedLinkError: /Applications/WebStorm.app/Contents/jdk/Contents/Home/jre/lib/libawt.dylib: dlopen(/Applications/WebStorm.app/Contents/jdk/Contents/Home/jre/lib/libawt.dylib, 1): Library not loaded: /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/JavaNativeFoundation
Referenced from: /Applications/WebStorm.app/Contents/jdk/Contents/Home/jre/lib/libawt.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1845)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at java.awt.Toolkit$3.run(Toolkit.java:1636)
at java.awt.Toolkit$3.run(Toolkit.java:1634)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1633)
at java.awt.Toolkit.<clinit>(Toolkit.java:1673)
at com.intellij.ui.AppUIUtil.updateFrameClass(AppUIUtil.java:155)
at com.intellij.idea.StartupUtil.prepareAndStart(StartupUtil.java:94)
at com.intellij.idea.MainImpl.a(MainImpl.java)
at com.intellij.idea.MainImpl.start(MainImpl.java:43)
... 6 more
The folder /System/Library/Frameworks/JavaVM.framework/Versions/A/Frameworks/JavaNativeFoundation.framework/Versions/A/ is not there and I can't find any instructions online on how to install it. I tried installing Oracle JDK 8 from the official binaries again but the installation fails with no details. I managed to install Oracle JDK 10 from the official binaries but the folder still isn't there. How can I fix this?
Thanks.
So I came across this post that lead me to the solution. I used Pacifist to extract JavaVM.framework from the High Sierra install dmg.

NoSuchMethodError com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity

I am running a Java test program to establish a connection to OrientDB and keep getting these exceptions when I run the code from within IntelliJ IDEA or OpenFire (xmpp server):
java.lang.NoSuchMethodError:
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder;
at
com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.(OSBTreeCollectionManagerAbstract.java:43)
at
com.orientechnologies.orient.core.db.record.ridbag.sbtree.OSBTreeCollectionManagerAbstract.(OSBTreeCollectionManagerAbstract.java:48)
at
com.orientechnologies.orient.client.remote.OSBTreeCollectionManagerRemote.(OSBTreeCollectionManagerRemote.java:58)
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:526) at
java.lang.Class.newInstance(Class.java:379) at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$2.call(ODatabaseDocumentTx.java:2863)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx$2.call(ODatabaseDocumentTx.java:2854)
at
com.orientechnologies.common.concur.resource.OSharedContainerImpl.getResource(OSharedContainerImpl.java:64)
at
com.orientechnologies.orient.core.storage.OStorageAbstract.getResource(OStorageAbstract.java:143)
at
com.orientechnologies.orient.client.remote.OStorageRemoteThread.getResource(OStorageRemoteThread.java:658)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.initAtFirstOpen(ODatabaseDocumentTx.java:2853)
at
com.orientechnologies.orient.core.db.document.ODatabaseDocumentTx.open(ODatabaseDocumentTx.java:260)
at
com.orientechnologies.orient.jdbc.OrientJdbcConnection.(OrientJdbcConnection.java:63)
at
com.orientechnologies.orient.jdbc.OrientJdbcDriver.connect(OrientJdbcDriver.java:52)
at java.sql.DriverManager.getConnection(DriverManager.java:571) at
java.sql.DriverManager.getConnection(DriverManager.java:187) at
com.momentum.orientdb.core.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:87)
at
com.momentum.orientdb.core.JdbcConnectionManager.getConnection(JdbcConnectionManager.java:56)
at
com.momentum.orientdb.core.JdbcConnectionManager$getConnection.call(Unknown
Source) at
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:112)
at
com.momentum.orientdb.core.test.JdbcConnectionManagerTest.testGetConnection(JdbcConnectionManagerTest.groovy:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160) at
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:78)
at
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:212)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Any idea why? How can I fix it?
UPDATE 1
It seems to me that it has to do with this library (from Google): concurrentlinkedhashmap-lru-1.4.1.jar.
But I searched the development computer's file system and found only the above mentioned version (1.4.1).
UPDATE 2 - Solution
After searching thoroughly I found that I had different version of concurrentlinkedhashmap-lru-xxxx.jar on my development machine's file system and somehow I "managed" to put two different versions in the build.
Meanwhile, I still get the same exceptions when using my library (which I've already tested) in order to establish a connection to OrientDb from within OpenFire since OpenFire uses another version of concurrentlinkedhashmap then the one being used by OrientDb (concurrentlinkedhashmap-lru-1.4.1.jar).
NoSuchMethodError happens because at runtime, Java tried to call a method on an object, and found it didn't exist, in particular:
com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder.maximumWeightedCapacity(J)Lcom/googlecode/concurrentlinkedhashmap/ConcurrentLinkedHashMap$Builder;
Of course, you'd expect the code wouldn't compile if that was the case, so this almost always means you've built against a different version of the class than the one provided at runtime - it's usually a versioning issue.
So, you should figure out which library you're getting ConcurrentLinkedHashMap from, and compare this with the version being used at runtime (how are you deploying this? Is it running straight from IntelliJ?). You're likely to find that they have different versions, and you'll need to alter your version to match.
Please go to the below link and download the JAR file,
http://mvnrepository.com/artifact/com.googlecode.concurrentlinkedhashmap/concurrentlinkedhashmap-lru/1.4.2
The problem is with the version which you are trying, the correct version is 1.4.2.

Cannot open some applications in VisualVM

I am using Ubuntu 14.04 with Oracle JDK 8. I want to inspect performance of my application using VisualVM. I can inspect other applications like JDownloader but I can't inspect my own applications and Eclipse 4.3. Before I made fresh install of Ubuntu, I was using JDK 7 and I have no problem and using it without any configuration. It gives following log.
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor com.sun.tools.visualvm.core.ui.DataSourceWindowManager$1
java.lang.IllegalArgumentException: Unexpected composite type for ThreadInfo
at sun.management.ThreadInfoCompositeData.validateCompositeData(ThreadInfoCompositeData.java:372)
at sun.management.ThreadInfoCompositeData.getInstance(ThreadInfoCompositeData.java:68)
at java.lang.management.ThreadInfo.<init>(ThreadInfo.java:263)
at java.lang.management.ThreadInfo.from(ThreadInfo.java:794)
Caused: 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.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$CompositeBuilderViaFrom.fromCompositeData(DefaultMXBeanMappingFactory.java:1018)
Caused: java.io.InvalidObjectException: Failed to invoke from(CompositeData)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory.invalidObjectException(DefaultMXBeanMappingFactory.java:1457)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$CompositeBuilderViaFrom.fromCompositeData(DefaultMXBeanMappingFactory.java:1021)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$CompositeMapping.fromNonNullOpenValue(DefaultMXBeanMappingFactory.java:919)
at com.sun.jmx.mbeanserver.DefaultMXBeanMappingFactory$NonNullMXBeanMapping.fromOpenValue(DefaultMXBeanMappingFactory.java:133)
at com.sun.jmx.mbeanserver.ConvertingMethod.fromOpenReturnValue(ConvertingMethod.java:131)
at com.sun.jmx.mbeanserver.MXBeanProxy.invoke(MXBeanProxy.java:168)
at javax.management.MBeanServerInvocationHandler.invoke(MBeanServerInvocationHandler.java:252)
Caused: java.lang.reflect.UndeclaredThrowableException
at com.sun.proxy.$Proxy8.getThreadInfo(Unknown Source)
at com.sun.tools.visualvm.jmx.impl.JmxSupport.isReadOnlyConnection(JmxSupport.java:95)
at com.sun.tools.visualvm.jmx.impl.JmxModelImpl.isTakeThreadDumpSupported(JmxModelImpl.java:311)
at com.sun.tools.visualvm.application.views.threads.ApplicationThreadsViewProvider.resolveThreads(ApplicationThreadsViewProvider.java:65)
at com.sun.tools.visualvm.application.views.threads.ApplicationThreadsViewProvider.supportsViewFor(ApplicationThreadsViewProvider.java:29)
at com.sun.tools.visualvm.application.views.threads.ApplicationThreadsViewProvider.supportsViewFor(ApplicationThreadsViewProvider.java:25)
at com.sun.tools.visualvm.core.ui.DataSourceViewsManager.getViews(DataSourceViewsManager.java:116)
at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.openWindowAndAddView(DataSourceWindowManager.java:169)
at com.sun.tools.visualvm.core.ui.DataSourceWindowManager.access$000(DataSourceWindowManager.java:30)
at com.sun.tools.visualvm.core.ui.DataSourceWindowManager$1.run(DataSourceWindowManager.java:80)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1393)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2005)
you should run visualvm on the same JDK version as your app, look at help->about->details (Java), mine was surprisingly jdk8 instead of jdk13 (I have both), so you can setup JDK version for visualvm manually etc/visualvm.conf, uncomment and setup parameter
visualvm_jdkhome=C:\Program Files\Java\jdk-13
run eclipse and your application with jvm parameters -Duser.language=en -Duser.country=us ...
then you will be able profile with jvisualvm.
for eclise put this two lines in eclipse.ini
-Duser.language=en
-Duser.country=us
maybe your pre installed Ubuntu had languge settings as english and you was ok.

Error when launching Java FX application on a headless Linux RedHat system

Trying to launch a java FX application on a Linux system using X. I get the following stack trace. After a bunch of googling and installing various packages, I am at a loss. Any thoughts?
java -jar tacoma_testing.jar
Prism-ES2 Error : GL_VERSION (major.minor) = 1.4
java.lang.reflect.InvocationTargetException
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:606)
at com.javafx.main.Main.launchApp(Main.java:698)
at com.javafx.main.Main.main(Main.java:871)
Caused by: java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /projects/tacoma/tacoma_regression_testing/jdk1.7.0_25/jre/lib/amd64/libglass.so: libgio-2.0.so.0: cannot open shared object file: No such file or directory
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:281)
at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:124)
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(Thread.java:724)
Caused by: java.lang.UnsatisfiedLinkError: /projects/tacoma/tacoma_regression_testing/jdk1.7.0_25/jre/lib/amd64/libglass.so: libgio-2.0.so.0: cannot open shared object file: No such file or directory
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:1843)
at java.lang.Runtime.load0(Runtime.java:795)
at java.lang.System.load(System.java:1061)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:200)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:88)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:31)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:73)
at com.sun.glass.ui.Application.loadNativeLibrary(Application.java:80)
at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:28)
at com.sun.glass.ui.gtk.GtkPlatformFactory$1.run(GtkPlatformFactory.java:25)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.glass.ui.gtk.GtkPlatformFactory.<clinit>(GtkPlatformFactory.java:25)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.sun.glass.ui.PlatformFactory.getPlatformFactory(PlatformFactory.java:20)
at com.sun.glass.ui.Application.Run(Application.java:103)
at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:271)
... 5 more
Redhat is not listed as as supported configuration for JavaFX 2.2.
Nor is running JavaFX in a headless mode.
This may change for Java 8, but Java 8 has not been released yet, so the list of supported configurations for JavaFX running on Java 8 has not been published.
Currently the supported configuration set for Linux is only => Ubuntu 10.4+ gtk2 2.18+ with optional additional requirements for av codecs if you also want media playback support.
So try using a supported Ubuntu system instead of Redhat and you may or may not get that working in a headless environment.
I tested and it works fine with Redhat 6. Redhat 5 seems to be the problem.
Redhat Enterprise Linux 6 support will be added for Java 8 (to be released in the next few weeks).
A RHEL 5.5 support request was closed as won't fix, see RT-22564 "JavaFX Support for Red Hat Enterprise Linux 5.5".
If you can find a way to install gtk2 2.18+ on RHEL 5 you may be able to get it to work, though no promises.

Categories

Resources