Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JavaFX, Java 6, and Linux

 
Matt Dalen
Greenhorn
Posts: 16
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all,

Is it possible to run a JavaFX jar on a box running Ubuntu and Java 6? I've gotten it running on Windows with Java 6, but the fact that a bunch of .dll files are required has me concerned. When I try to run it on the Ubuntu box, all I get is a blank screen.

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DLLs are specific to Windows. What do you need DLLS for?
 
Matt Dalen
Greenhorn
Posts: 16
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to run my jar in windows using java 6, with jfxrt.jar in the classpath, it still gives me errors - specifically, that it can't find glass.dll, one of the dlls in the JavaFX 2.2 SDK. If I make the dll files accessible to my jar (basically putting them in a local bin directory), it will run on Windows. I know the same technique won't work on Linux because dll files won't work there, but I'm wondering if there's an alternative way to make the jar runnable on Ubuntu with Java 6. (specifically, sdk 1.6.0_24).
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt Dalen wrote: I'm wondering if there's an alternative way to make the jar runnable on Ubuntu with Java 6. (specifically, sdk 1.6.0_24).

By definition, a JAR file is not runnable. Not on Windows not on Linux, or even OS-X.

You can, however, easily make a small script on OS-X or Linux that will execute the command to cause Java to execute the jar.
 
Matt Dalen
Greenhorn
Posts: 16
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Pat Farrell wrote:
Matt Dalen wrote: I'm wondering if there's an alternative way to make the jar runnable on Ubuntu with Java 6. (specifically, sdk 1.6.0_24).

By definition, a JAR file is not runnable. Not on Windows not on Linux, or even OS-X.

You can, however, easily make a small script on OS-X or Linux that will execute the command to cause Java to execute the jar.


Which is what I meant by runnable. But I'm running into the issue of executing a javafx jar on linux which has only java 6 installed.
 
Pat Farrell
Rancher
Posts: 4678
7
Linux Mac OS X VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt Dalen wrote:Which is what I meant by runnable. But I'm running into the issue of executing a javafx jar on linux which has only java 6 installed.


I am not an expert on FX, but I thought it required 7
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64632
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The fact that you needed to move a DLL means that your Windows Java installation likely has issues. You should not have to do that.

The implementation of Java on Linux and OS X will have their own implementation of whatever the Windows DLLs provide in something that's native to the environment.

But again, you shouldn't even have to know anything about that. You should not have to copy anything from the Java SDK into your own jars.
 
John Damien Smith
Ranch Hand
Posts: 260
13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to run a JavaFX jar on a box running Ubuntu and Java 6?

No. JavaFX for Linux only works on Java 7u6+.

By definition, a JAR file is not runnable. Not on Windows not on Linux, or even OS-X.
You can, however, easily make a small script on OS-X or Linux that will execute the command to cause Java to execute the jar.

The command to do this is (replace myjar.jar with the jar you want to execute):

When I try to run my jar in windows using java 6, with jfxrt.jar in the classpath, it still gives me errors - specifically, that it can't find glass.dll, one of the dlls in the JavaFX 2.2 SDK. If I make the dll files accessible to my jar (basically putting them in a local bin directory), it will run on Windows.

You should not need to manually place jfxrt.jar on the classpath nor move or copy it or any dlls or native parts of the jdk.

Use the JavaFX packaging tools to package your jar file and the tools will modify your jar to find the jfxrt.jar file and it's associated native libraries for any given platform which has the required minimum Java runtime for that platform installed. If the modified jar detects that the java version does not match a minimum required version, then the user will be informed that they need to install an update java runtime to run your application. If you develop using a NetBeans JavaFX project, e(fx)clipse project or with a maven javafx plugin, all of the tool interaction for your build will be automated for you and you will end up with a jar you can execute using java -jar (or click to run if the platform has the correct file associations between .jar files and the java runtime executable).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic