LoginSignup
2
0

More than 3 years have passed since last update.

jarのマニフェストファイルに変更が反映されない時の対処法

Last updated at Posted at 2019-08-14

jarのマニフェストファイルの変更を以下のようなコマンドにより反映させる時、

jar -cfm Main.jar main.mf *.class

jarのマニフェストファイルの文末に空白行を入れる必要がある。

main.mf
Main-Class : Main

以下のように文末に空白行が存在しない場合、

main.mf
Main-Class : Main

jarのマニフェストファイルの変更は反映されない。

この時、特にエラーメッセージが表示されないため、初学者の頃ハマってしまった。

参考

Modifying a Manifest File (The Java™ Tutorials > Deployment > Packaging Programs in JAR Files) https://docs.oracle.com/javase/tutorial/deployment/jar/modman.html

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0