I have Java desktop application that works with CSV files. And i want add some functionality. At this moment i need to open selected file with default system text editor. When i run my program on Windows i have no problems, just by calling notepad.exe, but what to do with *nix systems?
One way of solution is to customly set the way to preffered text editor in program options, but it is not a best solution…
But maybe it would be better add to program own text editor, even with less functionality ?
I believe
java.awt.Desktop.edit()may be what you’re looking for, although it will launch whatever the OS thinks the file should be edited with, which in the case of CSV is usually a spreadsheet app rather than a text editor – maybe you can rename the files to TXT temporarily or permanently.