This section explains how to create a JAR file from a module.
public class Person {
private String name;
private char gender;
private int age;
public Person(String n, char g, int a) {
name = n;
gender = g;
age = a;
}
@Override
public String toString( ) {
return String.format("%s %c %d",
name, gender, age);
}
}
public class Test1 {
public static void main(String[ ] args) {
Person p = new Person("Alice", 'F', 11);
System.out.println(p);
}
}
out/artifacts/personmodule_jar
This section explains how to add the JAR file as a dependency to the module testmodule.