Hi,
i created an executable jar of my java-prog. The application starts, but i'm getting in trouble when trying to access some files. (html files). I'm using a function getAppPath to retrieve the actual path of the class-file, but apperently this code doesn't work within the jar-archive.
So: how do i get the actual path of the jar-file within java?
Thanx in advance,
Daniel
Here is my getAppPath-Code
---------------------------------------
Visit me @:
i created an executable jar of my java-prog. The application starts, but i'm getting in trouble when trying to access some files. (html files). I'm using a function getAppPath to retrieve the actual path of the class-file, but apperently this code doesn't work within the jar-archive.
So: how do i get the actual path of the jar-file within java?
Thanx in advance,
Daniel
Here is my getAppPath-Code
Code:
package gui;
import java.net.*;
class getAppPath
{
public String getAppPath()
{
ClassLoader cl = this.getClass().getClassLoader();
URL u = cl.getResource(".");
return u.toString();
}
public static void main( String[] args )
{
}
}
---------------------------------------
Visit me @: