When my Java file-processing program is opened by an Open With… command, or is set as a file’s default program, how do I handle the file that opened it.
Is it passed as a command line argument?
In what format?
And how about programs, wrapped in an .exe wrapper, or compiled with an AOT compiler?
You should receive the file’s path as an argument in main().
See Using command-line argument for passing files to a program (maybe duplicated?)