I had installed the Point of Sale program called: uniCenta oPOS, which requires the installation of jre. It was running fine. But later I installed NetBeans, which uses jdk, to develop the uniCenta version with source code. After that my uniCenta program stopped launching, that is, the compiled, installed and executable uniCenta that I downloaded from the uniCenta webpage wont load anymore. It seems to me that the NetBeans installation changed something in Windows 10 because I cannot run the jar file anymore. And I tried a lot of options, like uninstalling NetBeans, uninstalling jre and reinstalling it, and uninstalling and reinstalling uniCenta. Nothing works. When I tried to run the uniCenta jar in cmd window, it doesn't run either and produces the following report:
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
That report comes from a program that runs perfectly in other computers. And it's an already installed and executable program, so errors make no sense.
What could be the problem? Any ideas? Thanks.
Solved: The solution was actually easy. Several Java versions were installed in my Window$ 10 PC at the same time (8, 17 and 19) and I had JRE and JDK. I supposed that they didn't interfere because they come from the same company (Oracle), but they did interfere. So I went to Apps & Features in Windows 10 Configuration section and uninstalled everything related to Java, which went smoothly. Then I reinstalled JRE so now I only have this Java version. UniCenta recognizes this Java without problems and now starts normally. After deleting 2 protocols to link with the DataBase, uniCenta loads now completely and normally. If one wanted to develop Java with NetBeans (JDK) and at the same time install uniCenta oPOS (JRE) in the Windows PC, turns out that the JDK doesn't supersede correctly the JRE subset. Shame on Oracle.