树莓派 armv几

In a previous post “Installing Java and JavaFX on the Raspberry Pi”, you can read how to install BellSoft LibericaJDK to be able to run JavaFX applications with a graphical user interface on a Raspberry Pi with ARMv7 or ARMv8 processor.

在上一篇文章“在Raspberry Pi上安装Java和JavaFX”中 ,您可以阅读如何安装BellSoft LibericaJDK以便能够在具有ARMv7或ARMv8处理器的Raspberry Pi上以图形用户界面运行JavaFX应用程序。

But this won’t work for some (older) versions of the Raspberry Pi as these use an ARMv6 processor which is not compatible with the default OpenJDK 11 which is part of Raspbian OS.

但这不适用于某些(较旧)版本的Raspberry Pi,因为这些版本使用ARMv6处理器,该处理器与Raspbian OS的默认OpenJDK 11不兼容。

This post will guide you through the steps to have a working Java JDK and JavaFX 11 on these Raspberry Pi board versions.

这篇文章将指导您完成在这些Raspberry Pi电路板版本上运行Java JDK和JavaFX 11的步骤。

准备一个ARMv6 Raspberry Pi板 (Prepare an ARMv6 Raspberry Pi board)

For this post, I’m using an old Raspberry Pi B+ 1.2. To be sure which ARM-version is used, check the output of “cat /proc/cpuinfo” in the terminal:

对于这篇文章,我使用的是旧的Raspberry Pi B + 1.2。 要确定使用哪个ARM版本,请在终端中检查“ cat / proc / cpuinfo”的输出:

$ cat /proc/cpuinfoprocessor  : 0model name : ARMv6-compatible processor rev 7 (v6l)BogoMIPS  : 697.95Features  : half thumb fastmult vfp edsp java tls CPU implementer   : 0x41CPU architecture: 7CPU variant    : 0x0CPU part : 0xb76CPU revision   : 7Hardware   : BCM2835Revision : 0010Serial      : 000000005f9ba615Model       : Raspberry Pi Model B Plus Rev 1.2

For a clear overview of the different board- and ARM-version, check this table on Wikipedia. The boards with ARMv6 are:

要清楚了解不同的Board版本和ARM版本,请查看Wikipedia上的此表 。 ARMv6的主板是:

  • Raspberry Pi 1 A and A+
    Raspberry Pi 1 A和A +
  • Raspberry Pi 1 B and B+
    Raspberry Pi 1 B和B +
  • Compute Module 1
    计算模块1
  • Zero 1.2, 1.3 and W
    零1.2、1.3和W

使用Raspbian OS准备SD卡(完整) (Prepare SD card with Raspbian OS (Full))

We start with a fresh new Raspbian OS on the SD card using the “Imager” tool.

我们首先使用“ Imager”工具在SD卡上使用全新的Raspbian OS。

When we now boot the Rasberry Pi board with an ARMv6 processor and check the Java version we get this result:

现在,当我们使用ARMv6处理器启动Rasberry Pi板并检查Java版本时,将得到以下结果:

$ java -version Error occurred during initialization of VM Server VM is only supported on ARMv7+ VFP

As expected, the default included OpenJDK for ARM is build for version 7 or higher, so doesn’t work on this ARMv6-based Raspberry Pi B+ 1.2.

不出所料,默认包含的OpenJDK for ARM是为版本7或更高版本构建的,因此在基于ARMv6的Raspberry Pi B + 1.2上不起作用。

关于Java JDK (About Java JDK)

The sources of Java are available through the open-source project OpenJDK. So anyone can build Java JDK packages — yes you can even do it yourself! — and luckily a lot of free pre-build versions are available.

Java的源代码可通过开源项目OpenJDK获得 。 因此任何人都可以构建Java JDK软件包-是的,您甚至可以自己做 ! —幸运的是,有许多免费的预构建版本可用。

安装Azul提供的Java 11 for ARMv6 (Install Java 11 for ARMv6 provided by Azul)

Only Azul seems to provide an ARMv6 version with there Zulu JDK, which is available for free!

只有Azul似乎提供带有Zulu JDK的ARMv6版本,该版本是免费的!

Let’s get it from their download page and extract it on our Raspberry Pi.

让我们从他们的下载页面获取它,并将其解压缩到我们的Raspberry Pi中。

$ cd /usr/lib/jvm$ sudo wget https://cdn.azul.com/zulu-embedded/bin/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf.tar.gz$ sudo tar -xzvf zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf.tar.gz$ sudo rm zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf.tar.gz$ ls -ltotal 12lrwxrwxrwx  1 root root   21 Jul 23 15:58 java-1.11.0-openjdk-armhf -> java-11-openjdk-armhfdrwxr-xr-x  9 root root 4096 Aug 20 11:41 java-11-openjdk-armhfdrwxr-xr-x  2 root root 4096 Aug 20 11:41 openjdk-11drwxrwxr-x 10  111  122 4096 Jul 10 16:50 zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf

OK, there it is! A new JDK on our board. Now let’s configure the OS to be aware of this new one.

好,那里! 我们板上的一个新JDK。 现在,我们将操作系统配置为了解这一新操作系统。

$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/java 1$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/javac 1

Now we can select the new JDK so it’s linked to the “java” and “javac” command.

现在,我们可以选择新的JDK,以便将其链接到“ java”和“ javac”命令。

$ sudo update-alternatives --config javaThere are 2 choices for the alternative java (providing /usr/bin/java).  Selection    Path                                                             Priority   Status------------------------------------------------------------* 0            /usr/lib/jvm/java-11-openjdk-armhf/bin/java                       1111      auto mode  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/java                       1111      manual mode  2            /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/java   1         manual modePress <enter> to keep the current choice[*], or type selection number: 2update-alternatives: using /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/java to provide /usr/bin/java (java) in manual mode$ sudo update-alternatives --config javacThere are 2 choices for the alternative javac (providing /usr/bin/javac).  Selection    Path                                                              Priority   Status------------------------------------------------------------* 0            /usr/lib/jvm/java-11-openjdk-armhf/bin/javac                       1111      auto mode  1            /usr/lib/jvm/java-11-openjdk-armhf/bin/javac                       1111      manual mode  2            /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/javac   1         manual modePress <enter> to keep the current choice[*], or type selection number: 2update-alternatives: using /usr/lib/jvm/zulu11.41.75-ca-jdk11.0.8-linux_aarch32hf/bin/javac to provide /usr/bin/javac (javac) in manual mode

If everything went well, we should be able to check the Java version now…

如果一切顺利,我们现在应该可以检查Java版本…

$ java -version openjdk version "11.0.8" 2020-07-14 LTS OpenJDK Runtime Environment Zulu11.41+75-CA (build 11.0.8+10-LTS) OpenJDK Client VM Zulu11.41+75-CA (build 11.0.8+10-LTS, mixed mode)

We have a winner! We now successfully replaced the default OpenJDK 11 (which only works on ARMv7+) with the Azul Zulu JDK which works on ARMv6.

我们有赢家! 现在,我们成功地将默认的OpenJDK 11(仅适用于ARMv7 +)替换为适用于ARMv6的Azul Zulu JDK。

使用未编译的Java文件进行测试 (Testing with a non-compiled Java file)

Let’s try out the newly installed Java JDK. Since Java 11, we can run Java-files directly without the need to compile them. Let’s create a simple file with nano and run it.

让我们尝试一下新安装的Java JDK。 从Java 11开始,我们无需编译即可直接运行Java文件。 让我们用nano创建一个简单的文件并运行它。

$ cd /home/pi$ nano HelloWorld.javapublic class HelloWorld {    public static void main (String[] args) {        System.out.println("Hello World");    }}$ java HelloWorld.javaHello World

Perfect! Java works as expected, but it takes about 15 seconds before the “Hello World” is shown on this old board dating from 2014.

完善! Java可以按预期工作,但是要花15秒钟的时间才能在2014年的旧主板上显示“ Hello World”。

JavaFX图形用户界面 (Graphical user interfaces with JavaFX)

If you also want to use JavaFX user interfaces, additional steps are needed as this library is not included in the JDK 11. It is developed as an independant open-source project on openjfx.io. The main contributor and maintainer is Gluon. They also offer commercial support to companies who want to use JavaFX for desktop and mobile application development.

如果您还想使用JavaFX用户界面,则需要额外的步骤,因为JDK 11中不包含该库。它是作为openjfx.io上的独立开源项目开发的 。 主要贡献者和维护者是Gluon 。 他们还为希望使用JavaFX进行桌面和移动应用程序开发的公司提供商业支持 。

Make sure you successfully updated to Azul Zulu JDK 11 before proceeding with the next steps.

在继续下一步之前,请确保您已成功更新到Azul Zulu JDK 11。

安装GluonHQ提供的Javav 11 for ARMv6 (Install JavaFX 11 for ARMv6 provided by GluonHQ)

We are going to use the free public version provided by Gluon on their download page.

我们将在其下载页面上使用Gluon提供的免费公共版本。

$ cd /home/pi $ wget -O javafx.zip https://gluonhq.com/download/javafx-11-0-2-sdk-armv6hf/ $ unzip javafx.zip $ rm javafx.zip

We can now check the JavaFX library which was unpacked in “armv6hf-sdk”:

现在,我们可以检查在“ armv6hf-sdk”中解压缩的JavaFX库:

pi@raspberrypi:~ $ ls -ltotal 44drwxr-xr-x 4 pi pi 4096 Mar 12  2019 armv6hf-sdkdrwxr-xr-x 2 pi pi 4096 Aug 20 11:40 Bookshelfdrwxr-xr-x 2 pi pi 4096 Aug 20 12:10 Desktop...$ ls -l armv6hf-sdk/total 8drwxr-xr-x 8 pi pi 4096 Mar 12  2019 legaldrwxr-xr-x 2 pi pi 4096 Mar 12  2019 lib$ ls -l armv6hf-sdk/lib/total 17124-rw-r--r-- 1 pi pi  845637 Mar 12  2019 javafx.base.jar-rw-r--r-- 1 pi pi 2761905 Mar 12  2019 javafx.controls.jar-rw-r--r-- 1 pi pi  143926 Mar 12  2019 javafx.fxml.jar-rw-r--r-- 1 pi pi 5270589 Mar 12  2019 javafx.graphics.jar-rw-r--r-- 1 pi pi  294822 Mar 12  2019 javafx.media.jar-rw-r--r-- 1 pi pi     992 Mar 12  2019 javafx.platform.properties-rw-r--r-- 1 pi pi     113 Mar 12  2019 javafx.properties-rw-r--r-- 1 pi pi   41802 Mar 12  2019 javafx-swt.jar-rw-r--r-- 1 pi pi  786021 Mar 12  2019 javafx.web.jar-rwxr-xr-x 1 pi pi   61200 Mar 12  2019 libdecora_sse.so-rwxr-xr-x 1 pi pi   31428 Mar 12  2019 libglass_monocle.so-rwxr-xr-x 1 pi pi   15946 Mar 12  2019 libglass_monocle_x11.so-rwxr-xr-x 1 pi pi  200074 Mar 12  2019 libglass.so-rwxr-xr-x 1 pi pi   22409 Mar 12  2019 libjavafx_font_freetype.so-rwxr-xr-x 1 pi pi   20508 Mar 12  2019 libjavafx_font_pango.so-rwxr-xr-x 1 pi pi   15206 Mar 12  2019 libjavafx_font.so-rwxr-xr-x 1 pi pi  231402 Mar 12  2019 libjavafx_iio.so-rwxr-xr-x 1 pi pi   43339 Mar 12  2019 libprism_common.so-rwxr-xr-x 1 pi pi   54506 Mar 12  2019 libprism_es2_monocle.so-rwxr-xr-x 1 pi pi   56505 Mar 12  2019 libprism_sw.so-rw-r--r-- 1 pi pi 6598638 Mar 12  2019 src.zip

使用最小的JavaFX应用程序进行测试 (Test with a minimal JavaFX application)

We are going to reuse the minimal JavaFX application which was created in this post “PiJava — Part 4 — Building a minimal JavaFX 11 application with Maven”. First, we need to clone the sources from GitHub:

我们将重复使用本文“ PiJava-第4部分-使用Maven构建最小的JavaFX 11应用程序”中创建的最小的JavaFX应用程序 。 首先,我们需要从GitHub克隆源:

$ cd /home/pi $ git clone https://github.com/FDelporte/MinimalJavaFx11Application.git

To be able to build the application, we also need Maven to be installed.

为了能够构建应用程序,我们还需要安装Maven。

$ sudo apt install maven

Now let’s build the application:

现在让我们构建应用程序:

$ cd MinimalJavaFx11Application $ mvn clean package

This will take some time as all the dependencies need to be downloaded.

这将需要一些时间,因为需要下载所有依赖项。

When finished, we can now run the application with the following start command which points to the downloaded JavaFX library and the generated jar-application in the out-directory of “MinimalJavaFx11Application”:

完成后,我们现在可以使用以下启动命令运行该应用程序,该命令指向下载的JavaFX库和“ MinimalJavaFx11Application”的输出目录中生成的jar应用程序:

$ sudo java --module-path /home/pi/armv6hf-sdk/lib       --add-modules=javafx.controls       -jar /home/pi/MinimalJavaFx11Application/out/MinimalJavaFx11Application-0.1-SNAPSHOT.jar

And there we have it! JavaFX running on an ARMv6 Raspberry Pi B+ 1.2!!!

我们终于得到它了! 在ARMv6 Raspberry Pi B + 1.2上运行的JavaFX !!!

Image for post

结论 (Conclusion)

Compared to the latest Raspberry Pi with a much faster processor and more memory, the application starts a lot slower on my 6-year old test board. But it works! Yes, really, it works :-)

与具有更快处理器和更多内存的最新Raspberry Pi相比,在我使用了6年的测试板上,该应用程序的启动速度要慢得多。 但这有效! 是的,真的,它有效:-)

Again this small-superhero-board proves to be able to handle everything, even the most modern Java versions on an old processor.

再次证明了这种小型超级英雄板能够处理所有内容,即使是旧处理器上最现代的Java版本也是如此。

And, if you like video, here is the video from Javarevisited Youtube Channel on how to install Java on Raspberry PI

而且,如果您喜欢视频,这是Javarevisited Youtube Channel上有关如何在Raspberry PI上安装Java的视频。

And, If you like this video and want to learn more you can also check the full course here — Use Java and Java FX on a Raspberry PI

而且,如果您喜欢此视频并希望了解更多信息,还可以在此处查看完整的课程- 在Raspberry PI上使用Java和Java FX

Originally published at https://webtechie.be.

最初发布在 https://webtechie.be

翻译自: https://medium.com/javarevisited/how-to-install-and-use-java-11-and-javafx-11-on-raspberry-pi-boards-with-armv6-processor-ca7109b76b7c

树莓派 armv几

http://www.taodudu.cc/news/show-2034673.html

相关文章:

  • armv6、armv7、armv7s、armv8、armv64及其i386、x86_64区别
  • armv6, armv7, armv7s的区别
  • ARM体系结构的发展之:ARMv6增加的系统支持
  • ARMv6 ARMv7 架构 整体介绍
  • 2021 9.14 p.m.小结 以及 数独问题探索(T3)
  • leetcode36.有效的数独(中等)
  • 创建数独小游戏uniapp/vue
  • 天呢,小学生都在B站讲算法?
  • C++项目学习(机器人方向)
  • 几种有趣的Magic Matrix
  • nankai 2082: 靶形数独 数独(9*9)求所有解 DLX+精确覆盖
  • 安卓开发3d模型展示源码_Android(安卓)全套开发资料视频+源码
  • 总共有多少个数独?
  • 基于OpenCV及Python的数独问题识别与求解(一)图像预处理
  • [转转]数独网址
  • Swing数独游戏(二):终盘生成之随机法
  • 数独九宫格
  • C++ - Sodoku Killer(DFS) - 实现一个数独解算器
  • 数独1--暴力回溯法(时间超)
  • 回溯法解数独游戏
  • C#程序员整理的Unity 3D笔记(十三):Unity 3D基于组件的思想
  • 计算机九宫格游戏怎么玩,《九宫格数独》怎么玩 数独玩法介绍
  • 数独 九宫格 破解
  • 【Unity3D日常开发】Unity3D中数字网格类游戏Demo实现
  • HTML5 Canvas制作数独游戏(二)
  • 简单数独的DFS求解
  • 数独算法
  • Java 数独题
  • c语言回溯算法数独,数独回溯算法
  • 在c语言中形参的作用域,【单选题】下列标识符中,属于块作用域的是( ) A. 函数形参 B. 语句标号 C. 函数外...

树莓派 armv几_如何在具有armv6处理器的树莓派板上安装和使用Java 11和JavaFX 11相关推荐

  1. 树莓派4bwlan驱动_【DIY纯手工】用树莓派DIY的桌面电脑

    树莓派是每一个技术男都想拥有的一款开发板,他功能强大,他强大的40pin扩展接口可以连接任何硬件,是学习智能硬件.软件编程的最优选择. MAKER:Samuel_Alexander/译:转自趣无尽 C ...

  2. 商品规格可选怎么设计_两分钟前|开平木质地栈板怎么安装

    两分钟前|开平木质地栈板怎么安装 zybzclcj 两分钟前|开平木质地栈板怎么安装 规定制造设备的材料不能对卡板木箱的性质.纯度.质量产生影响,其所用的材料需具有安全性.可辨别性及使用强度.木箱又称 ...

  3. pycharm调试如何返回上一步_如何在瑞芯微RK3399开发板上调用底层接口技术调试笔记...

    广东RK3399开发板DLT3399A底层接口文档如何调用方法在DLT3399A板卡正面写有GPIO和UART4_1V8丝印的接口,并看到板子反面对应的引脚gpio丝印,选择相对应的gpio控制节点, ...

  4. php转java知乎_做了三年多的php,在上一家公司转java一年多,如何找工作

    尝试了几家java的面试,面试过程所有的问题都解答得很顺畅,等结果出来之后却被告知因为年限不够,不想聘用,所以只能继续找php的岗位了吗? "年限不够"多半不是不想聘用的真实理由. ...

  5. serv-u 数据备份_如何使用用户数据脚本在EC2实例上安装Apache Web Server

    serv-u 数据备份 你好朋友, 在本教程中,我们将看到如何使用用户数据脚本在EC2实例上安装Apache Web Server. 在我以前的教程之一中,我已经解释了如何使用AWS控制台启动EC2实 ...

  6. scala unix时间戳_下载,在Linux,Unix,Windows上安装Scala

    scala unix时间戳 Today we will learn how to download Scala and then install Scala on Linux, Unix and Wi ...

  7. 在一起计时器_没想到吧?快手竟然给厕所上安装了计时器,或许职场从此再无带薪拉屎...

    loonggg 读完需要 3分钟 速读仅需 1 分钟 今天一大早醒来,就看到公众号吓脑湿的文章<从今天起,职场再无带薪拉屎>,里面的漫画对限制带薪拉屎进行了讽刺. 你说巧不巧,早上刚看到关 ...

  8. 亚马逊ec2 实例删除_在Amazon EC2实例中的Red Hat上安装SQL Server Linux

    亚马逊ec2 实例删除 This article explores the configuration of the Red hat Amazon EC2 instance for SQL Serve ...

  9. 安卓开发板烧写程序与安装软件的区别_在开发板上安装Android

    一.安装串口调试工具 开发Linux驱动程序无法像开发Android应用程序直接在Eclipse中开发,但是可以通过串口来通信.所以就需要安装串口调试工具,在这儿我们使用的串口调试工具是minicom ...

  10. 惠普 触摸板驱动_如何在HP触摸板上安装Android

    惠普 触摸板驱动 What's better than a $100 tablet? A $100 tablet that can run two operating systems! The Tou ...

最新文章

  1. .NET里面的Interop太烂了
  2. PostgreSQL 无会话、有会话模式 - 客服平均响应速度(RT)实时计算实践(窗口查询\流计算)...
  3. collect2: error: ld returned 1 exit status编译错误
  4. pyqt开发的程序模板_小程序定制开发和模板开发要多少钱?有什么区别?
  5. 三羊献瑞c语言编程入门,蓝桥杯-三羊献瑞,
  6. OLW (Open Live Writer)安装代码高亮插件方法(简明)
  7. ecshop 订单-》订单状态 2
  8. 轻松在阿里云上搭建Redis
  9. wikipedia_教职员工可以通过Wikipedia进行教学吗?
  10. 震惊!!!CSS垂直居中竟然有这么多方法~
  11. arduino动态刷新显示_2019 台北电脑展:华硕显示器产品精锐尽出
  12. python爬虫——使用selenium爬取qq群的成员信息(全自动实现自动登陆)
  13. 微软visio2013安装问题及解决过程
  14. Redis更新数据的时候如何不重置过期时间
  15. 联想交换机服务器型号,ThinkSystem DB610s光纤交换机
  16. 老板最“丧心病狂”的11个行为艺术
  17. python sqrt(4)*sqrt(9)_Python表达式sqrt(4)*sqrt(9)的值为__________。
  18. 用Python手把手教你做一只口红色号识别器,秒变李佳琦
  19. 用计算机判断函数单调性吗,判断函数单调性的常用方法
  20. java1.8安装及环境变量配置详细教程(专业保姆级,秒会)

热门文章

  1. hadoop+hbase安装
  2. IDEA中自动导包及快捷键
  3. 信捷PLC C功能块编程经验分享
  4. 电商产品安全要求(UL+IEC)
  5. php varbinary,php – 无法从MSSQL中获取varbinary数据
  6. android 添加文件打开方式
  7. CSS选取子标签元素:nth-child、first-child、last-child
  8. 基于视频会议系统的应急指挥项目建设方案
  9. 最简单代码,适合没学编程的人玩
  10. matlab命令及海洋作图