0

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
Le_Master
  • 147
  • 1
  • 2
  • 20

1 Answers1

0

Can you try use InputStream in = new FileInputStream("./EDMSWS");

tarikfasun
  • 314
  • 6
  • 16
  • Exception in thread "main" java.io.FileNotFoundException: .\EDMSWS (The system cannot find the file specified.) – Le_Master Jul 13 '15 at 15:29
  • http://stackoverflow.com/questions/9679867/selecting-a-file-in-another-directory-for-a-bufferedreader – tarikfasun Jul 13 '15 at 15:55