简体   繁体   English

为ARM运行JavaFX应用程序

[英]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. 我花了将近一天的时间试图找出为什么当我在Raspberry Pi上运行JavaFX .jar时,它不会打开UI。 I'm sure its something with my command to launch it. 我确信我的命令可以启动它。 I've been working off of this tutorial: 我一直在研究这个教程:

JFX on Raspberry Pi Raspberry Pi上的JFX

But cannot figure out what the "stopwatch.mainscreen" argument is for at the end. 但无法弄清楚最后的“stopwatch.mainscreen”论点是什么。

/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. stopwatch.MainScreen是要执行的类,-cp是类路径。 You need to be sure you're not using X11 since JFX only supports Framebuffering. 你需要确保你没有使用X11,因为JFX只支持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). 关于您提到的“Raspberry PI上的OpenJFX”教程,您可以通过查看提供的java源(在src目录中)来确定每个演示示例的主要类。

Here are the commands with right main classes to execute for each samples working on Raspberry PI : 以下是为Raspberry PI上的每个样本执行正确主要类的命令:

  • > /opt/jdk1.8.0/bin/java -cp StopWatch.jar stopwatch.MainScreen > /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 BouncingBalls.jar balls.Main
  • > /opt/jdk1.8.0/bin/java -cp Calculator.jar calc.MainScreen > /opt/jdk1.8.0/bin/java -cp Calculator.jar calc.MainScreen
  • > /opt/jdk1.8.0/bin/java -cp BrickBreaker.jar brickbreaker.Main > /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 : 对于“glGetError 0x505”错误,它意味着“超出视频内存”,因此您必须使用raspi-config实用程序增加分配给Raspberry GPU的内存量,您可以使用此命令运行该实用程序:

  • > sudo raspi-config > sudo raspi-config

Navigate to Advanced Options -> Memory Split, and specify 128 or 256 (64Mb aren't enough for provided samples) then reboot. 导航到高级选项 - >内存拆分,并指定128或256(64Mb不足以提供样本)然后重新启动。

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). 再次,正如托马斯解释的那样,请确保您在文本模式控制台中运行这些示例,因为当您运行图形桌面(startx)时它们将无法工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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