P
Philipp Kraus
Hello,
I would like to extract a directory of a Jar file. I read the path of
my Jar file with:
String l_jarfile =
Class.forName("class_within_the_jar").getResource("").toString();
l_jarfile = l_jarfile.substring(9,
l_jarfile.lastIndexOf(".jar!")) + ".jar";
This does not work on MS Windows systems (unix and OSX work correct
with this code).
If the Jar files is stored under a path like "C:\Users\myuser\Java
Files\myjar.jar" (with a space)
the JarFile-Object can't locate the file, because the space within the
directory is changed to %20
I need a solution to detect the location of a Jar File in a class. How
can i Do this in a correct way?
Thx
Phil
I would like to extract a directory of a Jar file. I read the path of
my Jar file with:
String l_jarfile =
Class.forName("class_within_the_jar").getResource("").toString();
l_jarfile = l_jarfile.substring(9,
l_jarfile.lastIndexOf(".jar!")) + ".jar";
This does not work on MS Windows systems (unix and OSX work correct
with this code).
If the Jar files is stored under a path like "C:\Users\myuser\Java
Files\myjar.jar" (with a space)
the JarFile-Object can't locate the file, because the space within the
directory is changed to %20
I need a solution to detect the location of a Jar File in a class. How
can i Do this in a correct way?
Thx
Phil