Question

I want to open the folder bestellingen with windows explorer. the folder is in the root directory of my project. so far I have this:

        Runtime rs = Runtime.getRuntime();
        try {
            Process p = rs.exec("./bestellingen/");
        } catch (IOException exc) {
            exc.printStackTrace();
        }

But if I run the project the error says "acces denied"

Was it helpful?

Solution

Directories can't be executed but you could do

File dir = new File("...");
if (Desktop.isDesktopSupported()) {
    Desktop.getDesktop().open(dir);
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top