1

I am currently developing a small application that reads and writes excel files for a form of sales report. This is all well and good, and the reading and writing works perfectly. The issue I am running into is that this needs to be exported as an executable .jar to run from the desktop of other computers. Exporting the .jar is simple, however when ran on a different computer, anytime one of my classes (i.e. "ExcelReader.java") reaches a point in the code that utilizes the Apache POI, the class crashes, but does not crash the entire code, in that the Main class ("Launcher") will still move through its main method and execute another class as it comes along, still crashing classes as it reaches usage of Apache POI. Any help would be greatly appreciated, and help understanding this issue even more so.This is a screenshot of my launcher class. It will reach give me the first JOptionPane, then no give me any of the JOP's I have in reader. However, it will proceed to the second JOP in Launcher and give me writer's JOP's UP UNTIL the first line of Apache POI code: This is a screenshot of my launcher class. It will reach give me the first JOptionPane, then no give me any of the JOP's I have in reader. However, it will proceed to the second JOP in Launcher and give me writer's JOP's UP UNTIL the first line of Apache POI code

Do the export boxes need to be highlighted for it to export with the jar file???

spaff
  • 163
  • 1
  • 16
  • 2
    Any stacktrace or error message? –  Jun 02 '17 at 12:29
  • @RC. Since I am running it through the executable on a different computer all I have to go off of is messages I display. However, it works fine on the computer I am coding it on. – spaff Jun 02 '17 at 12:39

1 Answers1

3

If I had to guess, this is a ClassNotFound exception being thrown. Depending on how you are packaging the jar, it may or may not contain Apache POI as a dependency.

Maven creates an uber jar where it opens up all jars and merges them together to create a single jar with all of the classes. You can look inside of the jar that you are exporting for the needed classes.

Here is a SO questions detailing how to create a single executable jar. There might be a couple more steps than just checking those libraries to be exported.

yxre
  • 3,576
  • 21
  • 20
  • Check my edit with the new photo. I may have just made a fool of myself without noticing that if this was the issue. – spaff Jun 02 '17 at 12:43