I understand this line of code runs .exe's based of a specific set location
Runtime.getRuntime().exec("C:/Users/Username/Desktop/JavaApp.exe").waitFor();
but I need it to run the application based off of the location of the class it is ran in
I understand this line of code runs .exe's based of a specific set location
Runtime.getRuntime().exec("C:/Users/Username/Desktop/JavaApp.exe").waitFor();
but I need it to run the application based off of the location of the class it is ran in
I'm gonna go ahead and make an answer for this question.
I believe this is what you're looking for.
For your comment asking about removal of the 'file' part from your string
Assuming you have a string called path which contains: "file:/C:/Users/Jon/Test/foo/Test.class"
You can call path.substring(5), which will return a string containing the text "/C:/Users/Jon/Test/foo/Test.class". The int just represents the index you want to start at for your new string, so you can change that as you need.