Execution fails with java -jar, while the same code works fine through eclipse

Recently, I have been packing the project, but it turned into a nightmare. So here is the problem in a nutshell. I have a project that I would like to have as a jar file, and ultimately use it as Java Web Start.

When I try to create and run code through Eclipse, it works fine. However, when I export it as a "runnable jar" and try to run it through the terminal, I get cryptic exceptions that seem to depend on the libraries referenced. I checked that the libraries are in the jar file, so it’s not that they are missing.

Depending on how I export it, the exception specification changes when it seems to get the same problem. The following is a stack trace when a project is exported with dependent libraries packaged as banks in the “main” bank.

Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.ExceptionInInitializerError
at org.eclipse.gef.tools.MarqueeSelectionTool.<init>(MarqueeSelectionTool.java:99)
at org.gvt.MarqueeZoomTool.<init>(MarqueeZoomTool.java:16)
at org.gvt.action.MarqueeZoomToolAction$1.<init>(MarqueeZoomToolAction.java:28)
at org.gvt.action.MarqueeZoomToolAction.createTool(MarqueeZoomToolAction.java:28)
at org.gvt.action.AbstractGEFToolAction.<init>(AbstractGEFToolAction.java:24)
at org.gvt.action.MarqueeZoomToolAction.<init>(MarqueeZoomToolAction.java:20)
at org.gvt.TopMenuBar.createBarMenu(TopMenuBar.java:113)
at org.gvt.ChisioMain.createMenuManager(ChisioMain.java:612)
at org.eclipse.jface.window.ApplicationWindow.addMenuBar(ApplicationWindow.java:235)
at org.gvt.ChisioMain.main(ChisioMain.java:144)
... 5 more
Caused by: java.lang.IllegalArgumentException: Argument cannot be null
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.graphics.Resource.<init>(Unknown Source)
at org.eclipse.swt.graphics.Cursor.<init>(Unknown Source)
at org.eclipse.draw2d.Cursors.<clinit>(Cursors.java:170)
... 15 more

By the way, I saved the XML / ANT output of the export process, which I could add if it could be of interest. I decided to omit it for fewer riots.

Any ideas on what might be the issue here?

EDIT: I'm starting to think if this is a 32/64-bit problem with the SWT-GTK library. Can anyone confirm or deny this?

+3
source share
2 answers

, eclipse 32- JVM ( - ), , SWT. , , :

- SWT Mac

,

0

, , . : "- SWT-, ).

GEF. Eclipse, Java Eclipse?

Eclipse, runnable Jar. RCP. Google RCP, .

0

Source: https://habr.com/ru/post/1769325/


All Articles