I have written a program and it runs fine when run through eclipse. I exported everything to an executable jar file. When I double click the jar to run it, it does not run. So I ran it via cmd with -jar and have received the errors below. What do these mean? What can I do to get executable jar working.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Matthew>java.exe -jar "C:\users\matthew\desktop\thegame.jar"
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Caused by: java.lang.NullPointerException
... 5 more
It looks to me that You can in fact launch the jar successfully but it runs to a problem during execution. If the same code works launched within Eclipse, I would suspect the problem is caused by differences between these two runtime environments : Eclipse environment and command line environment.
To solve the problem, I propose investigating what happens in line 63 of MusicDataAccessor.java, as that is the place where the stack trace indicates the NullPointerException. You might send that line of code here to get hints on what can go wrong.
One thing I'd like to mention is that when you export a project from Eclipse as Runnable JAR file, it is exported with selected Eclipse launch configuration and Eclipse specific launch wrappers. To create a standard executable JAR file, you can export as JAR file and specify the main class in last screen of the wizard.