The Artima Developer Community
Sponsored Link

Java Buzz Forum
Running 32-bit JavaFX 2.1 Beta SDK On 64-bit Ubuntu 11.10

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Weiqi Gao

Posts: 1808
Nickname: weiqigao
Registered: Jun, 2003

Weiqi Gao is a Java programmer.
Running 32-bit JavaFX 2.1 Beta SDK On 64-bit Ubuntu 11.10 Posted: Feb 3, 2012 9:26 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Weiqi Gao.
Original Post: Running 32-bit JavaFX 2.1 Beta SDK On 64-bit Ubuntu 11.10
Feed Title: Weiqi Gao's Weblog
Feed URL: http://www.weiqigao.com/blog/rss.xml
Feed Description: Sharing My Experience...
Latest Java Buzz Posts
Latest Java Buzz Posts by Weiqi Gao
Latest Posts From Weiqi Gao's Weblog

Advertisement

[Update Fri Feb 3 21:59:05 CST 2012] I started this blog a few days ago with the goal of playing JavaFX videos on 64-bit Ubuntu Linux. It turned out to be a longish post. So I'll just put the result here at the top, showing one of the video playing JavaFX 2 program at work. (This is an example from the upcoming Apress book Pro JavaFX 2 Platform. It's written by Dean Iverson. Thanks Dean.)

Your browser does not support HTML 5 video. Here's the link to the video file.

Tobias left a comment on the JavaFX 2.1 SDK Developer Preview Comes To Linux post 7 days ago:

Comment from Tobias on January 26, 2012 2:59:02 AM CST #:

Hi,

I think it is really nice to have an early preview of JavaFX 2.1 on Linux. However, I am also on a 64-bit Ubuntu and I cannot find out how to add the 32-bit libraries -- as soon as I try one of the 386 or multiarch versions, synaptics wants to remove hundreds of packages that I use daily.

I am really happy with JavaFX 2, which I believe is the best way to work with Java today -- but I am very tired of having to use VirtualBox and Win7 to get it working, so any help in installing the correct libraries would be great!

Let us hope that Oracle gives JavaFX on Linux the love it needs and deserves! I think they will.

According to the release notes, JavaFX 2.1 Developer Preview for Linux requires

  • Ubuntu Linux 10.04 or higher (32 or 64 bit)
  • JDK 6 update 26 or higher
  • GTK+ 2 2.18 or higher
  • libavcodec (for media)

Since the JavaFX 2.1 Beta SDK is 32-bit, I need 32-bit versions of the dependencies. On my 64-bit Ubuntu 11.10, I have already installed the 32-bit Sun JRE using Synaptic by installing the ia32-sun-java6-bin package. This package has a dependency ia32-lib which contains the 32-bit GTK+. There is no 32-bit Oracle JDK in the 64-bit Ubuntu's repositories, but it can be easily downloaded from Oracle's JDK download page. I downloaded the 32-bit JDK 7 update 2. With these software installed, I can start the sample programs such as the Ensamble.jar.

"JavaFX

The dependency libavcodec turns out to be more problematic. Synaptic does show a libavcodec53:i386 package. But it is marked to be in conflict with the 64-bit version of libavcodec53. And if I choose to install it, 12 64-bit packages will be removed, including libavcodec53 and its dependencies, among them gnome. Apparently that is not desirable. Plus, the JavaFX 2.1 shared object that has a dependency on libavcodec is fxavcodecplugin.so. It is linked against libavcodec.so.52:

weiqi@gao:/opt/javafx-sdk2.1.0-beta/rt/bin$ LD_LIBRARY_PATH=. ldd  fxavcodecplugin.so 
	linux-gate.so.1 =>  (0xf76e1000)
	libgstreamer-lite.so => ./libgstreamer-lite.so (0xf75ec000)
	libgobject-2.0.so.0 => /usr/lib32/libgobject-2.0.so.0 (0xf7575000)
	libgthread-2.0.so.0 => /usr/lib32/libgthread-2.0.so.0 (0xf756e000)
	librt.so.1 => /lib32/librt.so.1 (0xf7565000)
	libglib-2.0.so.0 => /lib32/libglib-2.0.so.0 (0xf746c000)
	libavcodec.so.52 => not found
	libpthread.so.0 => /lib32/libpthread.so.0 (0xf7451000)
	libc.so.6 => /lib32/libc.so.6 (0xf72d6000)
	libm.so.6 => /lib32/libm.so.6 (0xf72ac000)
	libgmodule-2.0.so.0 => /usr/lib32/libgmodule-2.0.so.0 (0xf72a7000)
	libffi.so.6 => /usr/lib32/libffi.so.6 (0xf72a0000)
	libpcre.so.3 => /lib32/libpcre.so.3 (0xf7261000)
	/lib/ld-linux.so.2 (0xf76e2000)
	libdl.so.2 => /lib32/libdl.so.2 (0xf725b000)

So I have to somehow get the content of the package of the 32-bit libavcodec52, probably from an earlier Ubuntu release, without going through Synaptic, The easiest way to do this is through the Ubuntu Packages website. A few minutes of poking around reveals that libavcodec52 is available from Lucid Lynx (10.04), Maverick Meerkat (10.10), and Natty Narwhal (11.04). I choose to download it from http://packages.ubuntu.com/lucid/libavcodec52. I also downloaded all its dependencies (except libc6 and zlib1g, which I'm pretty sure is already part of ia32-lib. Here's the list of *.deb files I downloaded:

weiqi@gao$ ls -l *deb
-rw-rw-r-- 1 weiqi weiqi 4470450 2012-02-03 20:42 libavcodec52_0.6.4-0ubuntu0.11.04.1_i386.deb
-rw-rw-r-- 1 weiqi weiqi   78724 2012-02-03 20:41 libavutil50_0.6.4-0ubuntu0.11.04.1_i386.deb
-rw-rw-r-- 1 weiqi weiqi   27556 2012-02-03 20:42 libgsm1_1.0.13-3_i386.deb
-rw-rw-r-- 1 weiqi weiqi   16594 2012-02-03 20:43 libogg0_1.2.0~dfsg-1_i386.deb
-rw-rw-r-- 1 weiqi weiqi  158080 2012-02-03 20:42 liborc-0.4-0_0.4.11-2_i386.deb
-rw-rw-r-- 1 weiqi weiqi  255362 2012-02-03 20:42 libschroedinger-1.0-0_1.0.10-2_i386.deb
-rw-rw-r-- 1 weiqi weiqi  112208 2012-02-03 20:43 libspeex1_1.2~rc1-1ubuntu1_i386.deb
-rw-rw-r-- 1 weiqi weiqi  357600 2012-02-03 20:43 libtheora0_1.1.1+dfsg.1-3_i386.deb
-rw-rw-r-- 1 weiqi weiqi   33602 2012-02-03 20:44 libva1_1.0.8-3_i386.deb
-rw-rw-r-- 1 weiqi weiqi   93674 2012-02-03 20:44 libvorbis0a_1.3.2-1ubuntu1_i386.deb
-rw-rw-r-- 1 weiqi weiqi  116528 2012-02-03 20:45 libvorbisenc2_1.3.2-1ubuntu1_i386.deb
-rw-rw-r-- 1 weiqi weiqi  236094 2012-02-03 20:45 libvpx0_0.9.6-1_i386.deb

Now I can extract the content of these *.deb files with the following command:

weiqi@gao$ for x in *.deb; do dpkg -x $x /opt/libavcodec52-i386; done

This will populate the /opt/libavcodec52-i386/usr/lib directory with the shared objects needed by the JavaFX 2.1 Beta SDK:

weiqi@gao:/opt/libavcodec52-i386/usr/lib$ ls
dri                    liborc-test-0.4.so.0           libva.so.1
i686                   liborc-test-0.4.so.0.11.0      libva.so.1.0.8
libavcodec.so.52       libschroedinger-1.0.so.0       libvorbisenc.so.2
libavcodec.so.52.72.2  libschroedinger-1.0.so.0.10.0  libvorbisenc.so.2.0.8
libavutil.so.50        libspeex.so.1                  libvorbis.so.0
libavutil.so.50.15.1   libspeex.so.1.5.0              libvorbis.so.0.4.5
libgsm.so.1            libtheoradec.so.1              libvpx.so.0
libgsm.so.1.0.12       libtheoradec.so.1.1.4          libvpx.so.0.9
libogg.so.0            libtheoraenc.so.1              libvpx.so.0.9.6
libogg.so.0.7.0        libtheoraenc.so.1.1.2          sse2
liborc-0.4.so.0        libtheora.so.0
liborc-0.4.so.0.11.0   libtheora.so.0.3.10

Finally, I need to tell the 32-bit Java process where to find these shared objects. I accomplish this with setting the LD_LIBRARY_PATH environment variable:

weiqi@gao$ export LD_LIBRARY_PATH=/opt/libavcodec52-i386/usr/lib

Now, I can run JavaFX media programs on my 64-bit Ubuntu 11.10 box. One of the results is shown at the beginning of the post.

For those who trust this website, (which you in general shouldn't, unless you know me personally or pseudo-personally) here's a file that you may be interested in getting. :)

Read: Running 32-bit JavaFX 2.1 Beta SDK On 64-bit Ubuntu 11.10

Topic: Best String examples with tutorials in java Previous Topic   Next Topic Topic:

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use