我使用最新的Install4J制作了一个安装程序,并希望在raspberry pi上安装该软件包进行测试。
它正在运行最新的Raspbian图像及最新更新和openJDK v.1.8.0.40
如果我尝试以无人值守模式启动安装程序(-q),我会得到一个"启动安装程序..."消息,然后我得到一个NullPointerException。
这是控制台输出:
pi@raspberrypi:~ $ ./plentyBase.sh -q
Starting Installer ...
java.lang.NullPointerException
at javax.swing.RepaintManager.currentManager(RepaintManager.java:262)
at javax.swing.JComponent.repaint(JComponent.java:4799)
at java.awt.Component.repaint(Component.java:3303)
at javax.swing.JComponent.setFont(JComponent.java:2756)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:208)
at javax.swing.plaf.basic.BasicPanelUI.installDefaults(BasicPanelUI.java:66)
at javax.swing.plaf.basic.BasicPanelUI.installUI(BasicPanelUI.java:56)
at javax.swing.JComponent.setUI(JComponent.java:664)
at javax.swing.JPanel.setUI(JPanel.java:153)
at javax.swing.JPanel.updateUI(JPanel.java:126)
at javax.swing.JPanel.<init>(JPanel.java:86)
at javax.swing.JPanel.<init>(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:117)
at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:50)
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67)
at com.install4j.runtime.installer.frontend.headless.UnattendedScreenExecutor.<init>(UnattendedScreenExecutor.java:48)
at com.install4j.runtime.installer.frontend.headless.InstallerUnattendedScreenExecutor.<init>(InstallerUnattendedScreenExecutor.java:10)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58)
at com.install4j.runtime.installer.Installer.main(Installer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
An error occurred:
java.lang.NullPointerException
Error log: /tmp/install4jError7183942791429390239.log
java.lang.NullPointerException
at javax.swing.RepaintManager.currentManager(RepaintManager.java:262)
at javax.swing.JComponent.repaint(JComponent.java:4799)
at java.awt.Component.repaint(Component.java:3303)
at javax.swing.JComponent.setFont(JComponent.java:2756)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:208)
at javax.swing.plaf.basic.BasicPanelUI.installDefaults(BasicPanelUI.java:66)
at javax.swing.plaf.basic.BasicPanelUI.installUI(BasicPanelUI.java:56)
at javax.swing.JComponent.setUI(JComponent.java:664)
at javax.swing.JPanel.setUI(JPanel.java:153)
at javax.swing.JPanel.updateUI(JPanel.java:126)
at javax.swing.JPanel.<init>(JPanel.java:86)
at javax.swing.JPanel.<init>(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:117)
at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:50)
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67)
at com.install4j.runtime.installer.frontend.headless.UnattendedScreenExecutor.<init>(UnattendedScreenExecutor.java:48)
at com.install4j.runtime.installer.frontend.headless.InstallerUnattendedScreenExecutor.<init>(InstallerUnattendedScreenExecutor.java:10)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58)
at com.install4j.runtime.installer.Installer.main(Installer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
这是错误日志的内容:
pi@raspberrypi:~ $ cat /tmp/install4jError7183942791429390239.log
Exception:
java.lang.NullPointerException
at javax.swing.RepaintManager.currentManager(RepaintManager.java:262)
at javax.swing.JComponent.repaint(JComponent.java:4799)
at java.awt.Component.repaint(Component.java:3303)
at javax.swing.JComponent.setFont(JComponent.java:2756)
at javax.swing.LookAndFeel.installColorsAndFont(LookAndFeel.java:208)
at javax.swing.plaf.basic.BasicPanelUI.installDefaults(BasicPanelUI.java:66)
at javax.swing.plaf.basic.BasicPanelUI.installUI(BasicPanelUI.java:56)
at javax.swing.JComponent.setUI(JComponent.java:664)
at javax.swing.JPanel.setUI(JPanel.java:153)
at javax.swing.JPanel.updateUI(JPanel.java:126)
at javax.swing.JPanel.<init>(JPanel.java:86)
at javax.swing.JPanel.<init>(JPanel.java:109)
at javax.swing.JPanel.<init>(JPanel.java:117)
at com.install4j.runtime.installer.frontend.FormPanel.<init>(FormPanel.java:50)
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(AbstractHeadlessScreenExecutor.java:67)
at com.install4j.runtime.installer.frontend.headless.UnattendedScreenExecutor.<init>(UnattendedScreenExecutor.java:48)
at com.install4j.runtime.installer.frontend.headless.InstallerUnattendedScreenExecutor.<init>(InstallerUnattendedScreenExecutor.java:10)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Installer.java:88)
at com.install4j.runtime.installer.Installer.runInProcess(Installer.java:58)
at com.install4j.runtime.installer.Installer.main(Installer.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:65)
at com.install4j.runtime.launcher.UnixLauncher.main(UnixLauncher.java:57)
System properties:
java.runtime.name=OpenJDK Runtime Environment
exe4j.moduleName=/home/pi/plentyBase.sh
sun.boot.library.path=/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/arm
java.vm.version=25.40-b08
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=:
java.vm.name=OpenJDK Zero VM
file.encoding.pkg=sun.io
sun.java.launcher=SUN_STANDARD
sun.os.patch.level=unknown
install4j.exeDir=/home/pi/
java.vm.specification.name=Java Virtual Machine Specification
user.dir=/home/pi/plentyBase.sh.939.dir
java.runtime.version=1.8.0_40-internal-b04
java.awt.graphicsenv=sun.awt.X11GraphicsEnvironment
i4jv=0
java.endorsed.dirs=/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/endorsed
os.arch=arm
java.io.tmpdir=/tmp
line.separator=
java.vm.specification.vendor=Oracle Corporation
os.name=Linux
exe4j.totalDataLength=36451286
sun.java2d.noddraw=true
sun.jnu.encoding=UTF-8
java.library.path=/home/pi/plentyBase.sh.939.dir/user::/usr/java/packages/lib/arm:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
java.specification.name=Java Platform API Specification
java.class.version=52.0
os.version=4.4.50+
i4j.vpt=true
install4j.cwd=/home/pi
user.home=/home/pi
user.timezone=Etc/UTC
java.awt.printerjob=sun.print.PSPrinterJob
file.encoding=UTF-8
install4j.jvmDir=/usr/lib/jvm/java-8-openjdk-armhf/jre
java.specification.version=1.8
java.class.path=i4jruntime.jar
user.name=pi
java.vm.specification.version=1.8
sun.java.command=com.install4j.runtime.launcher.UnixLauncher launch 0 com.install4j.runtime.installer.Installer -q
java.home=/usr/lib/jvm/java-8-openjdk-armhf/jre
sun.arch.data.model=32
user.language=en
java.specification.vendor=Oracle Corporation
awt.toolkit=sun.awt.X11.XToolkit
java.vm.info=interpreted mode
java.version=1.8.0_40-internal
java.ext.dirs=/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/ext:/usr/java/packages/lib/ext
sun.boot.class.path=/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/resources.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/rt.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/sunrsasign.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/jsse.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/jce.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/charsets.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/lib/jfr.jar:/usr/lib/jvm/java-8-openjdk-armhf/jre/classes
java.awt.headless=true
install4j.appDir=/home/pi/
java.vendor=Oracle Corporation
file.separator=/
java.vendor.url.bug=http://bugreport.sun.com/bugreport/
sun.font.fontmanager=sun.awt.X11FontManager
sun.io.unicode.encoding=UnicodeLittle
sun.cpu.endian=little
sun.cpu.isalist=
相同的安装程序在虚拟机中的Ubuntu 16.04 LTS上正常工作。
编辑: 我认为它来自JPanel init来获取FontMetrics?
在此处找到:NPE when calling new JPanel() in headless (RepaintManager.currentManager)
所以它看起来像是install4J中的一个错误。
如果我在raspberry pi上以desktop / gui模式打开安装程序,安装程序工作正常。
任何想法有什么不对?