java - Running an .exe based off of a class' location -
i understand line of code runs .exe's based of specific set location
runtime.getruntime().exec("c:/users/username/desktop/javaapp.exe").waitfor();
but need run application based off of location of class ran in
i'm gonna go ahead , make answer question.
i believe this you're looking for.
for comment asking removal of 'file' part string
assuming have string called path contains: "file:/c:/users/jon/test/foo/test.class"
you can call path.substring(5), return string containing text "/c:/users/jon/test/foo/test.class". int represents index want start @ new string, can change need.
Comments
Post a Comment