shell - Setting the path of properties file along with Java command -


i have created shell script run project in ubuntu. there had give properties file path along java command.

i'm using command not working file not loading , giving nullpointerexception i'm trying use it.

/usr/lib/jvm/java-7-openjdk-i386/bin/java" -cp $classpath -doligosoft.posconfig.file=/home/mlpc04/paritosh/pos_3.0/resources/posconfig.properties com.floreantpos.main.main

in classpath had given location file located don't know going wrong please suggest me command i'm using correct or problem else.

edit

private static void loadposconfig() {      string filename = system.getproperty( "oligosoft.posconfig.file" );       posconfig = new properties(); system.out.println(filename);       file file = new file(filename);       system.out.println( file.getabsolutepath());       fileinputstream inputstream = null;       try {          inputstream = new fileinputstream( file ); posconfig.load(inputstream);      } catch ( exception e) { logger.error( "not able load configuration" , e ); } 

i using file in method of application,but m trying provide file through script.

you have typo in shell invocation using -doligosoft.posconfig.file=... instead of -doligosoft.posconfig.file=...


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -