• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. OpenJFX
  4. OpenJFX on the Raspberry Pi

Page History

Versions Compared

Old Version 5

changes.mady.by.user Daniel Blaukopf

Saved on Jul 10, 2013

compared with

New Version 6

changes.mady.by.user Daniel Blaukopf

Saved on Jul 15, 2013

  • Previous Change: Difference between versions 4 and 5
  • Next Change: Difference between versions 6 and 7
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Make sure to expand the filesystem, or you won't have enough room to install the JDK.
  • If you are using the device primarily with JavaFX, you will probably not want to select "Enable Boot to Desktop". JavaFX on the Pi takes over the whole screen and does not interact with the Linux desktop.
  • Under "Advanced Options" you can select "Memory Split" to allocate memory to the graphics processor. A 50/50 split will let you get most use out of JavaFX accelerated graphics.
  • If you are using JavaFX over ethernet, it can be convenient to turn on the SSH server under "Advanced Options". Since JavaFX takes over input devices, it can be hard to stop an application if you don't have an SSH connection to it from another machine.
Tip

If you are connecting to your Pi over the network, you can save some time by setting a host name for it in raspi-config, then installing the avahi-daemon package (sudo apt-get install avahi-daemon from the command line). You'll then be able to reach the Pi from a Linux PC with the command: ssh pi@<host name>.local

If the Raspberry Pi isn't detecting the screen size correctly, you might need to tweak video mode settings and maybe tell the Pi to ignore the capabilities reported by the display.

...

JDK 8 EA builds for the Raspberry Pi include full support for hardware accelerated graphics, with everything from the base, graphics, controls and FXML modules. Media and Web modules are not included.

Stopping an application

JavaFX on the Raspberry Pi takes over the whole screen and captures all Linux input devices. While this will generally be the behavior you want in a deployed application, it is less convenient for development because you can't stop an application using control-C unless the JavaFX application has a KeyEvent handler that listens for control-C and calls Platform.exit(). There's nothing unusual about this - many Linux fullscreen console applications have the same behavior - but it is often useful to have a quick way to end an an application during development without changing the application code. 

There are two ways to run applications with the ability to be terminated by control-C:

  • Run applications over an ssh connection from a PC. This gives most control over the device, because once you have ssh connections set up then you can use them for other purposes as well.
  • Alternatively, you can use a built-in debugging feature to trap control-C. If you set the environment variable JAVA_DEBUG=1 before starting Java then JavaFX will exit when you press control-C. For example
Code Block
themeMidnight
languagebash
JAVAFX_DEBUG=1 /opt/jdk1.8.0/bin/java -cp Stopwatch.jar stopwatch.MainScreen
Warning

The JAVAFX_DEBUG environment variable is only for use in development and you shouldn't rely on it for deployment of your application. In the future this functionality might be specified different or be removed.

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.21
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 333, "requestCorrelationId": "7cdc8813ee74b8da"}