Run-time issue with jar file on a computer. What to look for?
I have a very simple program written in Java with IntelliJ IDEA that uses the JFileChooser to present the user with a dialog for reading files. It uses a .txt filter and works great when I run it inside the IDE on my main Mac computer. The corresponding artifact jar file also works great on other Mac computers. But for some odd reason, when I run the jar file from the computer which created it (my main Mac) almost no folders/files are shown in the JFileChooser read-file dialog! However, as mentioned, the code runs fine on the computer inside the IDE... That leads me to think that there is a problem on that computer with the IDE installation and/or java itself. I un-installed the IDE and installed it again. But the problem remains. The code runs fine inside the IDE but the dialog has a bug when run from the jar file. What other things can I do to try to fix this? Could this be a OS version issue? I have yet to try another computer with the same version of Mac OS. Or can I install a java run-time in addition to the IDE that is on it? Thanks!
Please sign in to leave a comment.
I just found the solution in the thread linked below!! It has the exact same issue (Newer Mac OS security settings with the Jar launcher!) and the solution works great!
https://stackoverflow.com/questions/65469536/why-does-a-jar-file-have-no-permissions-to-read-from-disk-when-started-via-doubl