简体   繁体   中英

Running JavaFX application for ARM

I've spent nearly a day trying to figure out why when I run a JavaFX .jar on my Raspberry Pi, it wont open up the UI. I'm sure its something with my command to launch it. I've been working off of this tutorial:

JFX on Raspberry Pi

But cannot figure out what the "stopwatch.mainscreen" argument is for at the end.

/opt/jdk1.8.0/bin/java -cp Stopwatch.jar stopwatch.MainScreen

thanks for any help you smart smart people can provide!

stopwatch.MainScreen is the class to execute and -cp is the class path. You need to be sure you're not using X11 since JFX only supports Framebuffering.

Regarding "OpenJFX on the Raspberry PI" tutorial you mentionned, you can figure the main class to execute for each demo sample by looking into provided java source (in src directory).

Here are the commands with right main classes to execute for each samples working on Raspberry PI :

  • > /opt/jdk1.8.0/bin/java -cp StopWatch.jar stopwatch.MainScreen
  • > /opt/jdk1.8.0/bin/java -cp BouncingBalls.jar balls.Main
  • > /opt/jdk1.8.0/bin/java -cp Calculator.jar calc.MainScreen
  • > /opt/jdk1.8.0/bin/java -cp BrickBreaker.jar brickbreaker.Main

For your "glGetError 0x505" error, it means "out of video memory", so you have to increase memory amount allocated to your Raspberry's GPU, using raspi-config utility, which you can run with this command :

  • > sudo raspi-config

Navigate to Advanced Options -> Memory Split, and specify 128 or 256 (64Mb aren't enough for provided samples) then reboot.

Again, as Thomas explained it, be sure you're running these samples in text-mode console, since they won't work when you're running graphical desktop (startx).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM