B4J Tutorial B4J on linux


Well-Known Member
Licensed User
Hi zolive33,
I need to see how to install B4J on ubuntu step by step, Where should I find it? Thank you in advance.


Licensed User
Install B4J on Ubuntu step by step :

1-Remove OpenJdk (not compatible with JavaFX)
sudo apt-get purge openjdk*

2-install Java 7 Jdk (for linux)
Download 32bit or 64bit Linux "compressed binary file" (.tar.gz)
Main page : http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Linux x86 -> http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-i586.tar.gz
or Linux x64 -> http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz

Uncompress it:
Linux x86 -> tar -xvf jdk-7u2-linux-i586.tar.gz (32bit)
or Linux x64 -> tar -xvf jdk-7u2-linux-x64.tar.gz (64bit)

move the JDK 7 directory to /usr/lib:
sudo mkdir -p /usr/lib/jvm
sudo mv ./jdk1.7.0_02 /usr/lib/jvm/jdk1.7.0_51

Create links
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_51/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_51/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_51/bin/javaws" 1

Perhaps you have to update permissions of the executables (not necessary for me) :
sudo chmod a+x /usr/bin/java
sudo chmod a+x /usr/bin/javac
sudo chmod a+x /usr/bin/javaws
sudo chown -R root:root /usr/lib/jvm/jdk1.7.0_51

Active links
sudo update-alternatives --set "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_51/bin/java"
sudo update-alternatives --set "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_51/bin/javac"
sudo update-alternatives --set "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_51/bin/javaws"

3-install JavaFX (for linux)
Main page : http://www.oracle.com/technetwork/java/javafx/downloads/index-jsp-136193.html
Linux x86-> http://download.oracle.com/otn-pub/....1-b35/javafx_scenebuilder-1_1-linux-i586.deb
or Linux x64 -> http://download.oracle.com/otn-pub/...1.1-b35/javafx_scenebuilder-1_1-linux-x64.deb
Execute <file>.deb

4-install wine 1.6
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.6

5-Active wine in 32bits then install dotnet 2.0:
WINEARCH=win32 WINEPREFIX=$HOME/.wine wine do_not_exists 2>/dev/null
WINEARCH=win32 WINEPREFIX=$HOME/.wine winetricks dotnet20

6-install jdk7 for windows:

8-at last... install B4J:
install B4J
run wine config, add programm B4J.exe and set dll gdiplus to native.

NB: you can't execute JavaFX directly from B4J. I think it's possible but i don't know how?
you can start JavaFX with Ubuntu Launcher.

In a few days I'll publish a shell script to automatise installation. Please be patient ;-)
Last edited: