ååã¯ãJavaã®ã³ã³ãã¤ã«ã¨å®è¡æã®ãã¹ã®é¢ä¿ãæ´çãã¾ããã
ä»åã¯ãJarãå«ããå ´åããã£ã¦ããã¾ãã
ããã§ã¯ãã£ã¦ããã¾ãï¼
åèæç®
ã¯ããã«
ãJavaã§ãã¶ã¤ã³ãã¿ã¼ã³ãå¦ã¶ãã®è¨äºä¸è¦§ã§ããè¯ãã£ããåèã«ãã¦ãã ããã
Javaã§ãã¶ã¤ã³ãã¿ã¼ã³ã®è¨äºä¸è¦§
Javaã®ã½ã¼ã¹ã³ã¼ãï¼.javaï¼ããjavacã³ãã³ãã§ã³ã³ãã¤ã«ããã¨ãä¸éã³ã¼ãããã¤ãã³ã¼ããªã©ã¨å¼ã°ããã¯ã©ã¹ãã¡ã¤ã«ï¼.classï¼ãä½ããã¾ãããã®ã¯ã©ã¹ãã¡ã¤ã«ã¯ãJavaVMï¼Java Virtual Machineï¼ã¯ãJavaä»®æ³ãã·ã³ãªã©ã¨å¼ã°ãããJVMã®ä¸ã§åãã¾ãã
é常ã®ããã°ã©ã ï¼ãã¤ãã£ãããã°ã©ã ï¼ã¯ãç´æ¥CPUã§å®è¡ã§ããããã°ã©ã ã§ãããJavaã®å ´åã¯ããã¤ãã³ã¼ãã¨ããä¸éã³ã¼ããä½ããã¨ã§ãWindowsãLinuxãMACã®ã©ã®ãã©ãããã©ã¼ã ã§ãåãããã«ãã¦ãã¾ãã
ä»åãããã¥ã¢ã«ãè¦ãªãããã£ã¦ããã¾ãã
docs.oracle.com
ä»å㯠Jarãã¡ã¤ã«ã対象ã«å ãã¾ãã
Jarãã¡ã¤ã«ã¨ã¯ãè¤æ°ã®ã¯ã©ã¹ãã¡ã¤ã«ããç»åããµã¦ã³ããªã©ã®ãã¡ã¤ã«ãZIPã§å§ç¸®ããã¢ã¼ã«ã¤ããã¡ã¤ã«ã§ããé©åãªMANIFESTãã¡ã¤ã«ãç¨æãããã¨ã§ãJarãã¡ã¤ã«èªä½ã§Javaãå®è¡ãããã¨ãã§ãã¾ãã
ã¨ã³ã¸ãã¢ã°ã«ã¼ãã®ã©ã³ãã³ã°ã«åå ä¸ã§ãã
æ°æ¥½ã«ãããã¨ãããããé¡ããããã¾ãð
ããã§ã¯ãã£ã¦ããã¾ãï¼
ãã¼ã¹ã¨ãªãç°¡åãªããã°ã©ã
Javaã®ãã¼ã¸ã§ã³ã確èªãã¾ããUbuntu22.04ã使ã£ã¦ã¾ãã
$ java -version
openjdk version "17.0.10" 2024-01-16
OpenJDK Runtime Environment (build 17.0.10+7-Ubuntu-122.04.1)
OpenJDK 64-Bit Server VM (build 17.0.10+7-Ubuntu-122.04.1, mixed mode, sharing)
ååã§ä½æããç°¡åãªJavaã®ã¢ããªã±ã¼ã·ã§ã³ã使ãã¾ãã
Main.javaã¯ãããã±ã¼ã¸ã«æå±ãã¦ããªã Sub.java ã¨ãããã±ã¼ã¸ã«æå±ãã¦ãã Pac.java ã®ã¯ã©ã¹ãå©ç¨ãã¦ãã¾ãã
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
`-- Sub.java
4 directories, 3 files
import com.example.Pac;
public class Main {
public static void main(String args[]){
System.out.println( "Hello Main !" );
String[] str = {"Main", "Sub"};
Sub sub = new Sub();
Pac pac = new Pac();
sub.main(str);
pac.main(str);
}
}
public class Sub {
public static void main(String args[]){
System.out.println( "Hello Sub !" );
}
}
package com.example;
public class Pac {
public static void main(String args[]){
System.out.println( "Hello Pac !" );
}
}
Main.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac -sourcepath src/:src/com/example/ Main.java
$ tree
.
|-- Main.class
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.class
|-- Pac.java
|-- Sub.class
`-- Sub.java
4 directories, 6 files
Main.classãçæããã¾ãããåããã¦ãSub.class 㨠Pac.class ãçæããã¾ããã
Main.classãå®è¡ãã¦ã¿ã¾ãã
$ java -cp .:src/:src/com/example/ Main
Hello Main !
Hello Sub !
Hello Pac !
ã¯ã©ã¹ãã¹ã®æå®ãè¤éã«ãªã£ã¦ãã¾ãã.
ã¯Mainã¯ã©ã¹ã«å¿
è¦ã§ãsrc
ã¯Pacã¯ã©ã¹ã«å¿
è¦ã§ãsrc/com/example
ã¯Subã¯ã©ã¹ã«å¿
è¦ã§ãã
æ¬æ¥ãJavaã¯ããã±ã¼ã¸ã¨ãã£ã¬ã¯ããªæ§é ãåãããã¹ããªã®ã§ã以ä¸ã®ãããªæ§æã«ããæ¹ãæ®éã ã¨æãã¾ãã
$ tree
.
|-- Main.java
|-- Sub.java
|-- classes
`-- com
`-- example
`-- Pac.java
3 directories, 3 files
ããããæ§æã«ããå ´åã«ã¤ãã¦ãæå¾ã«èª¬æãã¾ãã
Jarãã¡ã¤ã«ã®ä½ãæ¹
ããã¥ã¢ã«ã¯ç°¡åãªãã¨ã ããæ¸ããã¦ãã¾ãããããã¥ã¢ã«ã®ä¸ã«ãJavaãã¥ã¼ããªã¢ã«ããããããã«Jarã«é¢ãããã¥ã¼ããªã¢ã«ï¼ãã ããJava8ç¨ï¼ããã£ãã®ã§ããããè¦ãªãããã£ã¦ããã¾ãã
Jarãã¡ã¤ã«ã¯ãjarã³ãã³ãã§ä½ãã¾ããããããã®ãªãã·ã§ã³ãããã¾ãããããã§ã¯Jarãã¡ã¤ã«ãæ°è¦ä½æããå ´åã対象ã«ãã£ã¦ããã¾ãã
ä»å使ç¨ãããªãã·ã§ã³ã«ã¤ãã¦èª¬æãã¾ãã
- cï¼Jarãã¡ã¤ã«ãæ°è¦ä½æãã¾ãï¼fãªãã·ã§ã³ãæå®ããã¦ããå ´åã¯ãã¡ã¤ã«ã«åºåãããæå®ããã¦ãªãå ´åã¯æ¨æºåºåã«åºåããã¾ãï¼
- vï¼è©³ç´°ãªæ
å ±ãæ¨æºåºåã«åºåãã¾ã
- f jarfileï¼Jarãã¡ã¤ã«ãæå®ãã¾ã
- e entrypointï¼æå®ããã¨ã³ããªãã¤ã³ãã§å®è¡å¯è½ã«ãã¾ã
- tï¼Jarãã¡ã¤ã«ã®å
容ãä¸è¦§è¡¨ç¤ºãã¾ã
- -C dirï¼ä¸æçã«dirã«ãã£ã¬ã¯ããªãå¤æ´ãã¾ã
ããã±ã¼ã¸ã«æå±ãã¦ããªãã¯ã©ã¹ãå©ç¨ããå ´å
ã¾ããSubã¯ã©ã¹ã ããJarãã¡ã¤ã«ã«æ ¼ç´ãã¦ãMain.javaããå©ç¨ããå½¢ã§ãã£ã¦ã¿ã¾ãã
Main.javaããPacã¯ã©ã¹ã使ããªãããã«å¤æ´ãã¦ããã¾ãã
public class Main {
public static void main(String args[]){
System.out.println( "Hello Main !" );
String[] str = {"Main", "Sub"};
Sub sub = new Sub();
sub.main(str);
}
}
ã¾ããã¯ã©ã¹ãã¡ã¤ã«ãåé¤ãã¦ããã¾ãã
$ rm Main.class src/com/example/*.class
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
`-- Sub.java
4 directories, 3 files
Sub.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac src/com/example/Sub.java
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
|-- Sub.class
`-- Sub.java
4 directories, 4 files
Sub.classã§ãJarãã¡ã¤ã«ãä½æãã¾ãã
ããã§æ³¨æç¹ã§ããJarãã¡ã¤ã«ãä½æããã¨ãã対象ã®ã¯ã©ã¹ãã¡ã¤ã«ããã«ã¬ã³ããã£ã¬ã¯ããªã«ã¯ã©ã¹ãã¡ã¤ã«ãè¦ãã¦ããç¶æ
ã§ãJarãã¡ã¤ã«ãä½ããªãã¨ãã¾ãããã¾ããã§ããï¼å¾è¿°ãã¾ãããJarãã¡ã¤ã«ã¯ãã£ã¬ã¯ããªæ§æãä¿æããã®ã§ãã«ã¬ã³ããã£ã¬ã¯ããªä»¥å¤ã®ã¯ã©ã¹ãã¡ã¤ã«ãJarãã¡ã¤ã«ã«æ ¼ç´ããã¨ããã¾ãããã¾ããã§ããï¼ã
ã¨ãããã¨ã§ãSub.classãã¡ã¤ã«ã®ãããã£ã¬ã¯ããªã¾ã§ç§»åãã¦ãããJarãã¡ã¤ã«ãä½æãã¾ãã
$ cd src/com/example/
$ jar cvf Sub.jar Sub.class
ãããã§ã¹ãã追å ããã¾ãã
Sub.classã追å ä¸ã§ã(å
¥=411)(åº=283)(31%å縮ããã¾ãã)
$ cd -
$ mv src/com/example/Sub.jar classes/
$ tree
.
|-- Main.java
|-- classes
| `-- Sub.jar
`-- src
`-- com
`-- example
|-- Pac.java
|-- Sub.class
`-- Sub.java
4 directories, 5 files
$ jar tf classes/Sub.jar
META-INF/
META-INF/MANIFEST.MF
Sub.class
Sub.jarã移åããã®ã¯ãåããã£ã¬ã¯ããªã«ãSub.javaãSub.classãããã¨ãããã使ã£ã¦ãMain.javaãã³ã³ãã¤ã«ã§ãã¦ãã¾ãããã§ãã
Main.javaãã³ã³ãã¤ã«ãã¾ããMain.javaã¯Subã¯ã©ã¹ã«ä¾åãã¦ããã®ã§åä½ã§ã¯ã³ã³ãã¤ã«ã§ãã¾ãããã¯ã©ã¹ãã¹ã«ãå
ã»ã©ä½æããJarãã¡ã¤ã«ã追å ãã¾ãã
$ javac Main.java
Main.java:7: ã¨ã©ã¼: ã·ã³ãã«ãè¦ã¤ãããã¾ãã
Sub sub = new Sub();
^
ã·ã³ãã«: ã¯ã©ã¹ Sub
å ´æ: ã¯ã©ã¹ Main
Main.java:7: ã¨ã©ã¼: ã·ã³ãã«ãè¦ã¤ãããã¾ãã
Sub sub = new Sub();
^
ã·ã³ãã«: ã¯ã©ã¹ Sub
å ´æ: ã¯ã©ã¹ Main
ã¨ã©ã¼2å
$ javac -cp classes/Sub.jar Main.java
$ tree
.
|-- Main.class
|-- Main.java
|-- classes
| `-- Sub.jar
`-- src
`-- com
`-- example
|-- Pac.java
|-- Sub.class
`-- Sub.java
4 directories, 6 files
Jarãã¡ã¤ã«ã使ã£ã¦ãMain.javaãã³ã³ãã¤ã«ãããã¨ãåºæ¥ã¾ããã
ããã§ã¯ãå®è¡ãã¦ã¿ã¾ãã
ã¯ã©ã¹ãã¹ãæå®ããªãå ´åã¯ãã«ã¬ã³ããã£ã¬ã¯ããªãæ¢ãã¦ããã¾ãï¼ä»¥ä¸ã§ã¯ãHello Main !ã ãå®è¡ã§ãã¦ãã¾ãï¼ããã¯ã©ã¹ãã¹ãæå®ããã¨ãã«ã¬ã³ããã£ã¬ã¯ããªã¯è¦ã¦ããã¾ããããã£ã¦ãJarãã¡ã¤ã«ããããã£ã¬ã¯ããªã¨ãMain.classãããã«ã¬ã³ããã£ã¬ã¯ããªã®ä¸¡æ¹ãã¯ã©ã¹ãã¹ã«æå®ããå¿
è¦ãããã¾ãã
$ java Main
Hello Main !
Exception in thread "main" java.lang.NoClassDefFoundError: Sub
at Main.main(Main.java:7)
Caused by: java.lang.ClassNotFoundException: Sub
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
... 1 more
$ java -cp classes/Sub.jar Main
ã¨ã©ã¼: ã¡ã¤ã³ã»ã¯ã©ã¹Mainãæ¤åºããã³ãã¼ãã§ãã¾ããã§ãã
åå : java.lang.ClassNotFoundException: Main
$ java -cp .:classes/Sub.jar Main
Hello Main !
Hello Sub !
ããã±ã¼ã¸ã«æå±ãã¦ããªãã¯ã©ã¹ãå©ç¨ããå ´åã§å¥ãã£ã¬ã¯ããªã®ã¯ã©ã¹ãã¡ã¤ã«ãå©ç¨ããå ´å
次ã¯ãJarãã¡ã¤ã«ã«ãã£ã¬ã¯ããªæ§é ãæãããå ´åã§ããç¾ç¶ã®ç§ã®ç¥èã§ã¯ãã³ã³ãã¤ã«ã§ãã¾ããã§ããã
ã¯ã©ã¹ãã¡ã¤ã«ãJarãã¡ã¤ã«ã¯åé¤ããç¶æ
ããå§ãã¾ããMain.javaã¯Subã¯ã©ã¹ã ããåç
§ãã¦ãã¾ãã
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
`-- Sub.java
4 directories, 3 files
Sub.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac src/com/example/Sub.java
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
|-- Sub.class
`-- Sub.java
4 directories, 4 files
å¥ãã£ã¬ã¯ããªã«ã¯ã©ã¹ãã¡ã¤ã«ãããç¶æ
ã§ãJarãã¡ã¤ã«ãä½ãã¾ãã
$ jar cvf Sub.jar src/com/example/Sub.class
ãããã§ã¹ãã追å ããã¾ãã
src/com/example/Sub.classã追å ä¸ã§ã(å
¥=411)(åº=283)(31%å縮ããã¾ãã)
Jarãã¡ã¤ã«ã®å
容ã確èªãã¾ããSub.classããã£ã¬ã¯ããªæ§é ãæã£ã¦ãããã¨ãåããã¨æãã¾ãã
$ jar tf Sub.jar
META-INF/
META-INF/MANIFEST.MF
src/com/example/Sub.class
$ tree
.
|-- Main.java
|-- Sub.jar
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
|-- Sub.class
`-- Sub.java
4 directories, 5 files
ã§ã¯ããã®Jarãã¡ã¤ã«ã使ã£ã¦ãMain.javaãã³ã³ãã¤ã«ãã¦ããã¾ãã
Jarãã¡ã¤ã«ãã¯ã©ã¹ãã¹ã«æå®ããã ãã§ã¯å¤±æãã¾ãã
$ javac -cp Sub.jar Main.java
Main.java:7: ã¨ã©ã¼: ã·ã³ãã«ãè¦ã¤ãããã¾ãã
Sub sub = new Sub();
^
ã·ã³ãã«: ã¯ã©ã¹ Sub
å ´æ: ã¯ã©ã¹ Main
Main.java:7: ã¨ã©ã¼: ã·ã³ãã«ãè¦ã¤ãããã¾ãã
Sub sub = new Sub();
^
ã·ã³ãã«: ã¯ã©ã¹ Sub
å ´æ: ã¯ã©ã¹ Main
ã¨ã©ã¼2å
ãããããã£ã¦ã¿ã¾ããããã³ã³ãã¤ã«ã§ãã¾ããã§ããã
ããã±ã¼ã¸ã«æå±ãã¦ããã¯ã©ã¹ãå©ç¨ããå ´å
次ã¯ãããã±ã¼ã¸ã«æå±ãã¦ããã¯ã©ã¹ï¼Pac.javaï¼ãå©ç¨ããå ´åã§ãã
ã¾ããMain.javaãSubã¯ã©ã¹ã¯ä½¿ãããPacã¯ã©ã¹ã使ãããã«å¤æ´ãã¾ãã
import com.example.Pac;
public class Main {
public static void main(String args[]){
System.out.println( "Hello Main !" );
String[] str = {"Main", "Sub"};
Pac pac = new Pac();
pac.main(str);
}
}
ã½ã¼ã¹ãã¡ã¤ã«ã ãã®ç¶æ
ããå§ãã¾ãã
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
`-- Sub.java
4 directories, 3 files
ã¾ããPac.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac src/com/example/Pac.java
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.class
|-- Pac.java
`-- Sub.java
4 directories, 4 files
Pac.javaã¯ãpackage com.exampleããªã®ã§ãsrcãã£ã¬ã¯ããªã«ç§»åãã¦Jarãã¡ã¤ã«ãä½ãå¿
è¦ãããã¾ãã
$ cd src/
$ jar cvf Pac.jar com/example/Pac.class
ãããã§ã¹ãã追å ããã¾ãã
com/example/Pac.classã追å ä¸ã§ã(å
¥=423)(åº=294)(30%å縮ããã¾ãã)
$ jar tf Pac.jar
META-INF/
META-INF/MANIFEST.MF
com/example/Pac.class
$ cd ..
$ tree
.
|-- Main.java
|-- classes
`-- src
|-- Pac.jar
`-- com
`-- example
|-- Pac.class
|-- Pac.java
`-- Sub.java
4 directories, 5 files
ããã§ã¯ãMain.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac -cp src/Pac.jar Main.java
$ tree
.
|-- Main.class
|-- Main.java
|-- classes
`-- src
|-- Pac.jar
`-- com
`-- example
|-- Pac.class
|-- Pac.java
`-- Sub.java
4 directories, 6 files
ã³ã³ãã¤ã«ã§ããã®ã§ãå®è¡ãã¦ã¿ã¾ãã
$ java -cp .:src/Pac.jar Main
Hello Main !
Hello Pac !
æåãã¾ããã
-Cãªãã·ã§ã³ã使ã£ã¦ããã£ã¬ã¯ããªã移åããã«Jarãã¡ã¤ã«ãä½ãæ¹æ³
jarã³ãã³ãã®-Cãªãã·ã§ã³ã使ãã¨ã-Cãªãã·ã§ã³ã§æå®ãããã£ã¬ã¯ããªã«ç§»åãããã¨ã¨åãå¹æãããã¾ãã
ã½ã¼ã¹ãã¡ã¤ã«ï¼.javaï¼ä»¥å¤ã¯ããããããåé¤ãã¦ããã¾ãã
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.java
`-- Sub.java
4 directories, 3 files
Pac.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac src/com/example/Pac.java
$ tree
.
|-- Main.java
|-- classes
`-- src
`-- com
`-- example
|-- Pac.class
|-- Pac.java
`-- Sub.java
4 directories, 4 files
-Cãªãã·ã§ã³ã§srcãã£ã¬ã¯ããªã®ä½ç½®ã§Jarãã¡ã¤ã«ãä½ãã¾ããã¯ã©ã¹ãã¡ã¤ã«ã®æå®ããsrcãã£ã¬ã¯ããªããã®æå®ã«ãªããã¨ã«æ³¨æã§ãã
$ jar cvf classes/Pac.jar -C src/ com/example/Pac.class
ãããã§ã¹ãã追å ããã¾ãã
com/example/Pac.classã追å ä¸ã§ã(å
¥=423)(åº=294)(30%å縮ããã¾ãã)
$ tree
.
|-- Main.java
|-- classes
| `-- Pac.jar
`-- src
`-- com
`-- example
|-- Pac.class
|-- Pac.java
`-- Sub.java
4 directories, 5 files
ããã§ã¯ãMain.javaãã³ã³ãã¤ã«ãã¾ãã
$ javac -cp classes/Pac.jar Main.java
$ tree
.
|-- Main.class
|-- Main.java
|-- classes
| `-- Pac.jar
`-- src
`-- com
`-- example
|-- Pac.class
|-- Pac.java
`-- Sub.java
4 directories, 6 files
ã§ã¯ãå®è¡ãã¦ã¿ã¾ãã
$ java -cp .:classes/Pac.jar Main
Hello Main !
Hello Pac !
èªç¶ãªãã£ã¬ã¯ããªæ§æã®å ´å
æ¬æ¥ãJavaã¯ããã±ã¼ã¸ã¨ãã£ã¬ã¯ããªæ§é ãåãããã¹ããªã®ã§ã以ä¸ã®ãããªæ§æã«ããæ¹ãæ®éã§ãã
$ tree
.
|-- Main.java
|-- Sub.java
|-- classes
`-- com
`-- example
`-- Pac.java
3 directories, 3 files
ããããæ§æã«ããå ´åã®ã®ã³ã³ãã¤ã«ã§ãããªãã·ã§ã³ãæå®ããå¿
è¦ãããã¾ããã
$ javac Main.java
$ tree
.
|-- Main.class
|-- Main.java
|-- Sub.class
|-- Sub.java
|-- classes
`-- com
`-- example
|-- Pac.class
`-- Pac.java
3 directories, 6 files
å®è¡ãã¦ã¿ã¾ãã
$ java Main
Hello Main !
Hello Sub !
Hello Pac !
ããã«ãå®è¡å¯è½ãªJarãã¡ã¤ã«ãä½æãã¦ã¿ã¾ãã
ãªãã·ã§ã³ã® f
ï¼Jarãã¡ã¤ã«ãæ°è¦ä½æããï¼ã¨ãe
ï¼æå®ããã¨ã³ããªãã¤ã³ãã§å®è¡å¯è½ã«ããï¼ã®é åºã¨ãclasses/Main.jar
ï¼Jarãã¡ã¤ã«ï¼ã¨ Main
ï¼ã¨ã³ããªãã¤ã³ãï¼ã®é åºã¯åãã«ããå¿
è¦ãããã®ã§æ³¨æã§ãã
$ jar cvfe classes/Main.jar Main ./*.class com/example/Pac.class
ãããã§ã¹ãã追å ããã¾ãã
Main.classã追å ä¸ã§ã(å
¥=566)(åº=386)(31%å縮ããã¾ãã)
Sub.classã追å ä¸ã§ã(å
¥=411)(åº=283)(31%å縮ããã¾ãã)
com/example/Pac.classã追å ä¸ã§ã(å
¥=423)(åº=294)(30%å縮ããã¾ãã)
$ tree
.
|-- Main.class
|-- Main.java
|-- Sub.class
|-- Sub.java
|-- classes
| `-- Main.jar
`-- com
`-- example
|-- Pac.class
`-- Pac.java
3 directories, 7 files
å®è¡ãã¦ã¿ã¾ãã
$ java -jar classes/Main.jar
Hello Main !
Hello Sub !
Hello Pac !
æåã§ãï¼
ãããã«
Jarãã¡ã¤ã«ãå
¥ã£ã¦ããã¨ãããã«ããããããªãã¾ããããç解ãæ·±ã¾ãã¾ããï¼
ä¸é¨ãåºæ¥ãªãã£ãã¨ãããããã¾ããã解決ããããã¾ã追è¨ãããã¨æãã¾ãã
ä»åã®å
容ãåèã«ãªãã°å¹¸ãã§ãã
æå¾ã¾ã§ãèªã¿ããã ãããããã¨ããããã¾ããã