April 19th, 2017, 12:10 PM
Universal file path in Java
I have created a Java program which is executing cmd.exe and that cmd.exe is running a batch file which is installing SSL certificates to java keytool.
Now, the issue is i have specified the path of that .bat file as per my system. So, if i give that java program to anyone else it won't work because that person should not have the same file path.
Suppose my batch file is in C:/Java/Certificates/xyz.bat but the other might have xyz.bat in D:/Test/xyz.bat.
So, i want to know is there any provision of universal file path name in java through which it will find the xyz.bat from anywhere in the system?
April 19th, 2017, 01:09 PM
Re: Universal file path in Java
One solution might be to have the java program copy the bat file from inside the jar file to a temporary file on the PC and execute it from there and then delete it.
Tags for this Thread
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!