0
JARファイルが実行されるようにWindowsコマンドラインにプロパティファイルへのパスを含める方法を知りたいと思います。Cドライブの外部プロパティファイルを使用してWindowsコマンドからJava Jarを実行
ジャー/コマンドライン:java -jar Parser.jar
プロパティファイル:C:\Properties\Parser.properties
を、私は別の記事から、試してみた:
java -jar Parser.jar -Dconfig=C:\Properties\Parser.properties
しかしにおける結果は:
Exception during initialize() java.io.FileNotFoundException: Parser.propertie
s (The system cannot find the file specified)
java.io.FileNotFoundException: Parser.properties (The system cannot find the
file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at xxx.xxx.xxx.system.tools.parser.ParserMain.initialize(Parser
Main.java:100)
at xxx.xxx.xxx.system.tools.parser.ParserMain.main(ParserMain.j
ava:55)
プロパティファイルがクラスパスから選択された場合、うまく動作します。 java -classpath "C:\ Properties \ Parser.properties" -jar Parser.jar – lsiva