I have my jar file and properties file in same location (C:\test). When I run the jar through script, it throws FileNotFound exception for the properties file. This runs perfectly through RAD. What am I doing wrong here. I tried other ways, like getting the path of the jar file, etc, but no luck there too.
Script:
@echo off
REM Eventually change directory to the program directory
cd C:\test\
REM run the program
"C:\Program Files (x86)\Java\jre6\bin\java.exe" -jar "C:\test\test.jar"
Code to read properties file:
private void loadProperties() throws IOException{
appProperties = new Properties();
InputStream in = new FileInputStream("./EDMSWS.properties");
appProperties.load(in);
in.close();
}
Manifest File:
Manifest-Version: 1.0
Main-Class: org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader
Rsrc-Class-Path: ./ commons-io-2.4.jar JSQLConnect.jar poi-3.11-201412
21.jar
Class-Path: .
Rsrc-Main-Class: com.example.xxx.xxxxx