Drop the file on .jar and pass the file name to main ()

I would like to leave the file in my bank and pass the file name to my main method as an argument. I'm on OSX. How can i do this?

+7
source share
2 answers

If the application. deployed using Java Web Start , file association can be declared. Double-click on any file of this type, and the file path will be transferred to the main line (String []).

BTW is the demon . JNLP API Keep in mind the 2nd error report, which will mean the minimum version 1.6.0_10 +, in order to delete the file that was reset to the application icon.

+2
source

To do this on OSX, you may need to create an application package from your .jar. This process is well documented at the Apple Developer Center (scroll down to Mac OS X Application Bundle). You can create a Java application that fits very well with the OSX desktop if you make sure that they are there, and it's pretty easy.

+2
source

All Articles