I have a build developed on window.Now this build need to be deployed on linux in jar format.working as user wasadmin
In this jar I am loading application.properties file from /home/wasadmin/jar/application.properties. b.jar is also in same folder
I am trying two options 1)in = new FileInputStream( new File(propertiesFilePath+propertiesFile));
//sct01.px-dc.dl.com/home/wasadmin/jar/application.properties java.io.IOException: Unable to locate resource application.properties
where sct01.px-dc.dl.com is linux server name which I am reading as in = new FileInputStream(new File(propertiesFilePath+propertiesFile)); public static final String APPLICATION_PROPERTY_FILE = "application.properties"; public static final String APPLICATION_PROPERTY_FILE_PATH ="//sct01.px-dc.dl.com"+"/home/wasadmin/jar/";
2)if i replace above code with this in=ClassLoader.getSystemResourceAsStream("com/application.properties"); error message unable to access b.jar important point for 2nd is when i run this jar on windows it is working fine but when deployed on linux nothing happening
public static final String APPLICATION_PROPERTY_FILE_PATH ="//sct01.px-dc.dl.com"+"/home/wasadmin/jar/";
May I ask why you have added the "//sct01.px-dc.dl.com" to the front of the path?
If your code is on the same machine you don't need this (just use the "/home/wasadmin/jar/").
If your code is on a different machine, then you probably need to either tell it the network protocol lto use or (and probably a better solution) mount the remote directory somewhere in the filesystem of the local machine. But I would be surprised if this is the case from your description above.