I studying Create and work Jar file, but it's not work.
this is code,
package chapterthirteen;
/**
* @author user01
* 銀行を表すクラス。
*/
public class Bank {
/**
* 銀行の名前
*/
String name;
/**
* 銀行の住所s
*/
String address;
/**
* 口座を追加する。
* @param owner 口座名義人
* @param initialBalance 初期残高
*/
public void addAccount(String owner, int initialBalance) {
}
public static void main(String args[]) {
System.out.println("試験用のメインメソッドです。");
}
}
this is Manifest.txt what I typing
Manifest-Version: 1.0
Main-Class: chapterthirteen.Bank
this is Terminal Text
admin-no-MacBook-Air:chapterthirteen user01$ jar -cvmf manifest.txt Bank.jar Bank.class
マニフェストが追加されました
Bank.classを追加中です(入=776)(出=486)(37%収縮されました)
admin-no-MacBook-Air:chapterthirteen user01$ java -jar Bank.jar
Bank.jarにメイン・マニフェスト属性がありません
admin-no-MacBook-Air:chapterthirteen user01$
and, this is Menifest.MF(unzip file)
Manifest-Version: 1.0
Main-Class: chapterthirteen.Bank
Created-By: 9.0.4 (Oracle Corporation)
what is problem? and how can I working JAR file in terminal?
=================================================
for reference, I already know how can making JAR file in eclipse.
I just want to know, Create and Work JAR in terminal(for studying)
plz help me.
=================================================
translate in terminal
jar -cvmf manifest.txt Bank.jar Bank.class
マニフェストが追加されました
-> Manifestation has been added.
Bank.classを追加中です(入=776)(出=486)(37%収縮されました)
->Bank.Class is added.(in=776)(exit=486)(37 % contracted)
java -jar Bank.jar
Bank.jarにメイン・マニフェスト属性がありません
->Bank.jar does not have the main manifestos attribute.
admin-no-MacBook-Air:chapterthirteen user01$