安装NetBeans后Windows10中uniCenta oPOS无法启动的问题及解决
问题:安装NetBeans后uniCenta oPOS无法启动
此前安装依赖JRE的收银系统uniCenta oPOS运行状态正常,为开发该系统源码安装带JDK的NetBeans后,uniCenta oPOS无法启动。尝试卸载重装NetBeans、JRE及uniCenta均无效,在CMD窗口运行jar文件时出现如下报错日志:
C:\Program Files (x86)\unicentaopos-4.6.1>java -jar unicentaopos.jar SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Program%20Files%20(x86)/unicentaopos-4.6.1/lib/logback-classic-1.2.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Program%20Files%20(x86)/unicentaopos-4.6.1/lib/posapps-client-1.4.8-exe.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Program%20Files%20(x86)/unicentaopos-4.6.1/lib/weblaf-1.2.9.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Program%20Files%20(x86)/unicentaopos-4.6.1/lib/slf4j-simple-1.7.24.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder] 08:22:20.214 | java.lang.ExceptionInInitializerError java.lang.ExceptionInInitializerError: null at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:807) at com.thoughtworks.xstream.XStream.<init>(XStream.java:574) at com.thoughtworks.xstream.XStream.<init>(XStream.java:496) at com.thoughtworks.xstream.XStream.<init>(XStream.java:465) at com.thoughtworks.xstream.XStream.<init>(XStream.java:411) at com.thoughtworks.xstream.XStream.<init>(XStream.java:378) at com.alee.utils.XmlUtils.initializeXStream(XmlUtils.java:94) at com.alee.utils.XmlUtils.getXStream(XmlUtils.java:81) at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:148) at com.alee.managers.style.StyleManager.<clinit>(StyleManager.java:66) at com.alee.laf.label.WebLabelUI.installUI(WebLabelUI.java:96) at java.desktop/javax.swing.JComponent.setUI(JComponent.java:740) at java.desktop/javax.swing.JLabel.setUI(JLabel.java:274) at com.alee.laf.label.WebLabel.updateUI(WebLabel.java:466) at java.desktop/javax.swing.JLabel.<init>(JLabel.java:180) at java.desktop/javax.swing.JLabel.<init>(JLabel.java:251) at com.alee.laf.label.WebLabel.<init>(WebLabel.java:65) at com.alee.extended.statusbar.WebMemoryBar.<init>(WebMemoryBar.java:83) at com.openbravo.pos.forms.JRootApp.initComponents(JRootApp.java:985) at com.openbravo.pos.forms.JRootApp.<init>(JRootApp.java:195) at com.openbravo.pos.forms.JRootFrame.initFrame(JRootFrame.java:70) at com.openbravo.pos.forms.StartPOS.lambda$main$0(StartPOS.java:112) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.util.Comparator java.util.TreeMap.comparator accessible: module java.base does not "opens java.util" to unnamed module @414d77e at java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:387) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:363) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:311) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:180) at java.base/java.lang.reflect.Field.setAccessible(Field.java:174) at com.thoughtworks.xstream.core.util.Fields.locate(Fields.java:39) at com.thoughtworks.xstream.converters.collections.TreeMapConverter.<clinit>(TreeMapConverter.java:50) ... 35 common frames omitted 08:22:20.230 | java.lang.ExceptionInInitializerError java.lang.ExceptionInInitializerError: null at com.alee.laf.label.WebLabelUI.installUI(WebLabelUI.java:96) at java.desktop/javax.swing.JComponent.setUI(JComponent.java:740) at java.desktop/javax.swing.JLabel.setUI(JLabel.java:274) at com.alee.laf.label.WebLabel.updateUI(WebLabel.java:466) at java.desktop/javax.swing.JLabel.<init>(JLabel.java:180) at java.desktop/javax.swing.JLabel.<init>(JLabel.java:251) at com.alee.laf.label.WebLabel.<init>(WebLabel.java:65) at com.alee.extended.statusbar.WebMemoryBar.<init>(WebMemoryBar.java:83) at com.openbravo.pos.forms.JRootApp.initComponents(JRootApp.java:985) at com.openbravo.pos.forms.JRootApp.<init>(JRootApp.java:195) at com.openbravo.pos.forms.JRootFrame.initFrame(JRootFrame.java:70) at com.openbravo.pos.forms.StartPOS.lambda$main$0(StartPOS.java:112) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.NullPointerException: Cannot invoke "com.thoughtworks.xstream.XStream.processAnnotations(java.lang.Class)" because the return value of "com.alee.utils.XmlUtils.getXStream()" is null at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:148) at com.alee.managers.style.StyleManager.<clinit>(StyleManager.java:66) ... 25 common frames omitted Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: Could not initialize class com.alee.managers.style.StyleManager at com.alee.laf.label.WebLabelUI.uninstallUI(WebLabelUI.java:122) at java.desktop/javax.swing.JComponent.uninstallUIAndProperties(JComponent.java:755) at java.desktop/javax.swing.JComponent.setUI(JComponent.java:730) at java.desktop/javax.swing.JLabel.setUI(JLabel.java:274) at com.alee.laf.label.WebLabel.updateUI(WebLabel.java:471) at java.desktop/javax.swing.JLabel.<init>(JLabel.java:180) at java.desktop/javax.swing.JLabel.<init>(JLabel.java:251) at com.alee.laf.label.WebLabel.<init>(WebLabel.java:65) at com.alee.extended.statusbar.WebMemoryBar.<init>(WebMemoryBar.java:83) at com.openbravo.pos.forms.JRootApp.initComponents(JRootApp.java:985) at com.openbravo.pos.forms.JRootApp.<init>(JRootApp.java:195) at com.openbravo.pos.forms.JRootFrame.initFrame(JRootFrame.java:70) at com.openbravo.pos.forms.StartPOS.lambda$main$0(StartPOS.java:112) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.NullPointerException [in thread "AWT-EventQueue-0"] at com.alee.utils.XmlUtils.processAnnotations(XmlUtils.java:148) at com.alee.managers.style.StyleManager.<clinit>(StyleManager.java:66) at com.alee.laf.label.WebLabelUI.installUI(WebLabelUI.java:96) at java.desktop/javax.swing.JComponent.setUI(JComponent.java:740) at java.desktop/javax.swing.JLabel.setUI(JLabel.java:274) at com.alee.laf.label.WebLabel.updateUI(WebLabel.java:466) ... 21 more
该程序在其他电脑可正常运行。
解决方案
- 问题根源:Windows10设备中同时安装了多个Java版本(8、17、19)及JRE、JDK,存在版本冲突。
- 修复步骤:
- 通过Windows10的「应用和功能」卸载所有Java相关组件
- 重装适配uniCenta oPOS的JRE,系统即可正常启动
- 注意事项:若需同时使用NetBeans开发与uniCenta oPOS,需确保JDK与JRE版本兼容。
内容的提问来源于stack exchange,提问作者Carlos Botero
相关产品推荐
相关产品推荐

