B4J Question Run on raspberry

fixit30

Active Member
Licensed User
Longtime User
The first line of that thread states:

Edit: UI apps are no longer supported on Raspberry Pi. Non-ui apps work great and you can show an interface through the browser by implementing a web server.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
@fishwolf, did you run in debug mode? Is your app really a ui app as selected from b4j menu?
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
i have done this procedure

Step 1: Download http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u76-linux-arm32-vfp-hflt.gz
Step 2: sudo tar zxvf jdk-8u76-linux-arm32-vfp-hflt.gz -C /opt ->installs in /opt
Step3: sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_76/bin/javac 1
Step4 :sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_76/bin/java 1
Step5: sudo update-alternatives --config javac
Step6: sudo update-alternatives --config java
Step7: download http://108.61.191.178/downloads/openjfx-8u40-sdk-overlay-linux-armv6hf.zip
Step8: sudo unzip openjfx-8u40-sdk-overlay-linux-armv6hf.zip -d /opt/jdk1.8.0_76

The sample application is in release mode, but the problem is already present.
 
Upvote 0

Mark Read

Well-Known Member
Licensed User
Longtime User
Which version of Raspbian are you using, Wheezy or Jessie (new)?
Which version of Java are you using in B4J?
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Could you share a sample project to be able to test.

I have been testing OpenJFX with jdk1.8.0_73. See attached project. Running fine so far in full screen mode on the Raspberry Pi (latest Jessie Version).
 

Attachments

  • B4JHowToRPIOpenJFX.zip
    5 KB · Views: 233
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
Could you share a sample project to be able to test.

I have been testing OpenJFX with jdk1.8.0_73. See attached project. Running fine so far in full screen mode on the Raspberry Pi (latest Jessie Version).

also this project doesn't work on my raspberry.
i run this command
java -jar app.jar
start but don't show UI
 

Attachments

  • ShowView.zip
    3.5 KB · Views: 247
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
Hi,

tested your application on a Raspberry Pi 2 (OpenJFX jdk1.8.0_73, latest Jessie Version).
Running fine via
a) the b4j-bridge (running on the Raspberry Pi) and
b) from the desktop in a terminal session by invoking $sudo java -jar ShowView.jar. Note that you need to run as sudo else error that mouse class can not be found.

Note: Added a Close Button to be able to close the MainForm.

What error messages do you get?

BTW: This is the procedure I used to install Java and OpenJDK = again just to go for sure if this matches your installation steps.

#OpenJFX Installation on the Raspberry Pi
Status 20160212 using jdk-8u73: This can change depending on the Java JDK version.

Step 1
Download Java JDK for Linux ARM32
Open http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Accept the Licence Agreement
Download jdk-8u73-linux-arm32-vfp-hflt.tar.gz to /home/pi/Downloads

Step 2
Install JDK in folder /opt
cd /home/pi/Downloads
Unpack the tar.gz file to /opt:
sudo tar zxvf jdk-8u73-linux-arm32-vfp-hflt.tar.gz -C /opt

Step3
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk1.8.0_73/bin/javac 1

Step4
sudo update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_73/bin/java 1

Step5
sudo update-alternatives --config javac
In the dialog, select option 1

Step6
sudo update-alternatives --config java
In the dialog, select option 1

Step7
Download the OpenJFX
http://108.61.191.178/downloads/openjfx-8u40-sdk-overlay-linux-armv6hf.zip

Step8
Install the OpenJFX in folder /opt/jdk1.8.0_73
sudo unzip openjfx-8u40-sdk-overlay-linux-armv6hf.zip -d /opt/jdk1.8.0_73
 
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
I have followed all steps on a new raspberry installation

i have the same problem, the application start and run, but i don't see the UI (see screen-shot)
in shell i see the debug output
i'm using xrdp for a remote desktop, i don't think that is the problem, other application work fine
 

Attachments

  • Immagine.jpg
    Immagine.jpg
    100.4 KB · Views: 236
Upvote 0

rbghongade

Active Member
Licensed User
Longtime User
@fishwolf,
Probably your OS is using a default java installation and not the downloaded one (unless you have set the path to new installation via JAVA environment path)
Running the command: sudo /your new java path/java -jar /your program path/program.jar
may help.
 
Upvote 0

rwblinn

Well-Known Member
Licensed User
Longtime User
[CORRECTION]
Did experience the same, which means when starting the OpenJFX application from a Remote Desktop Terminal Session under xrdp, the application is NOT shown in the Remote Desktop Session BUT the application is shown instead on a Monitor which is directly connected to the Raspberry Pi when starting via Remote Desktop.

Question: Did you try looking up on a Monitor directly connected to the Raspberry Pi?

Started ShowView via Remote Desktop Terminal Session - the GUI is shown on the Monitor directly connected to the Raspberry Pi.
upload_2016-2-18_13-2-9.png
 
Last edited:
Upvote 0

fishwolf

Well-Known Member
Licensed User
Longtime User
IMG_20160218_195325.jpg
With the monitor the UI interface is showed, but the color are false and is not possible close the application.

maybe the first version of raspberry (256 Mb) is too sloow?
 
Upvote 0
Top