Hello everyone,I meet a question when I try to use Runtime.getRuntime().exec() to open a file.
I can use Runtime.getRuntime().exec() to open an exe file such as notepad.exe or mspaint.exe,
but How can I open a .txt or .jpg file?
Thank you
Printable View
Hello everyone,I meet a question when I try to use Runtime.getRuntime().exec() to open a file.
I can use Runtime.getRuntime().exec() to open an exe file such as notepad.exe or mspaint.exe,
but How can I open a .txt or .jpg file?
Thank you
What do you mean by "open" for a file? Do you want the OS to select a program(or do it yourself), start that program executing and have that program read the file and display it?
Look at the Desktop class.