Frage

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"

War es hilfreich?

Lösung

Directories can't be executed but you could do

File dir = new File("...");
if (Desktop.isDesktopSupported()) {
    Desktop.getDesktop().open(dir);
}
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top