How to avoid printing file not found exception (..\conf\log4j.xml) with complete stack trace while running the below command. I need to handle this exception and print message instead of complete stack trace.
"java -jar -Dlog4j.configuration="file:..\conf\log4j.xml" ..\simulationengine.jar"
Error: log4j:ERROR Could not parse url [file:..//conf//log4j.xml].
java.io.FileNotFoundException: ..\conf\log4j.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.www.protocol.file.FileURLConnection.connect(Unknown Source)
java -jar ..\simulationengine.jar
, put the log4j.xml file at the root of your classpath, e.g. in ..\simulationengine.jar and it will work fine.