生成jar包
myeclipse——>右键工程——>选择要导出的java——>export 导成jar包
Project1.jar
Project2.jar
Project3
package com.pc;
import com.pa.JavaA;
import com.pb.JavaB;
public class JavaC {
public void hello(){
System.out.println("my name is C ! ");
}
public static void main(String[] args) {
JavaA a=new JavaA();
a.hello();
JavaB b=new JavaB();
b.hello();
JavaC c=new JavaC();
c.hello();
}
}
image.png
image.png
C:\test>java -classpath ./firstJar.jar com.guoyasoft.actions.Test
网友评论