Mam taki program z biblioteką XStream:
import com.thoughtworks.xstream.*;
class Animals {
public Animals(String name, int age)
{
this.name = name;
this.age = age;
}
private String name;
private int age;
}
public class testX {
public static void main(String[] a ) {
Animals animal = new Animals("pupu",27);
XStream xstream = new XStream();
String xml = xstream.toXML(animal);
// zapisz String do pliku z rozszerzeniem .xml
}
}
Kompiluje go poleceniem:
javc -classpath (moja ścieżka do xtream)/xstream-1.4.7/lib/xstream-1.4.7.jar testX.java
Gdy chcę go opalić poleceniem:
java -classpath (moja ścieżka do xtream)/xstream-1.4.7/lib/xstream-1.4.7.jar XStreamTest
Error: Could not find or load main class XStreamTest
Wyświetlany jest powyższy błąd.