I created a java GUI application using java.awt. The basic idea off the app is to query a mongo database using the mongo-java driver.
When running the code from the command prompt, the GUI opens up and it can interact with the initialized mongod server just fine with no problem. However, when I create a jar executable with the same class, the GUI opens up fine, yet none of the server interactions seem to occur.
For instance, when running the non-jar version, the mongod server running in the background displays something along the lines of: Sat Dec 14 09:14:20.347 [initandlisten] connection accepted from 127.0.0.1:XXXX #5 (1 connection now open)
, yet when running the jar version (without making any changes to the source code at all, literally the same exact .java and .class files), I don't see any of the conection statuses on the server.
I doubt you need me to insert all my code into this post, but here are the details that I think are most relevant to my issue. Let me know if you need any other details.
when creating my jar I used the command:
jar cvfm MongoDBGUI.jar manifest.txt *.class
manifest.txt has the line:
Main-Class: MongoDBGUI
*MongoDBGUI being the class with the main function