I have created a java application that i would like to use as an external library. So i create a jar file and import it on a different project. When i use my library i call
notif.addMachineStat(ip,"Harvester");
which is declared as
public void addMachineStat(String ip,String computerTitle) throws InterruptedException, SigarException {
Resources rs=new Resources(new Sigar());
addMachineStat(ip,computerTitle,Double.toString(rs.getAllCpus()),Double.toString(rs.getMemory()),rs.getNetwork(),Double.toString(rs.getFreeHddPerc()));
}
The problem seems to be with the SigarException that is thrown from the second line (addMachineStat(....)
). For some reason the SigarException class (import org.hyperic.sigar.SigarException;
) is not carried from the jar file to the new project. Would i have to import it on the other project as well? isnt there a way to get it from the jar with out the user having to import it?
Funny thing, if I use Maven on the second project (my library project uses Maven in the first place), it seems to be working just fine.