i would like to use this example:
from http://labs.micromata.de/display/jak/KML+in+the+Java+world#KMLintheJavaworld-JAXBXSD%3DJAK
My Problem is: i've this message: i don't know how can i solve it?
I would be appreciate for any help.
Best regards,
Sphere
"HelloKml.class" doesnt contain ObjectFactory.class or jaxb.index
at
com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:
197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
.........
Code: [
public class HelloKml {
public static void main(String[] args) throws FileNotFoundException,
JAXBException, SAXParseException {
Kml kml = KmlFactory.createKml();
Placemark placemark = KmlFactory.createPlacemark();
placemark.setName("Bahareh- My Placemark");
placemark.setDescription("HelloKml");
placemark.setVisibility(true);
placemark.setStyleUrl("styles.kml#jugh_style");
placemark.createAndSetLookAt()
.withLongitude(-90.86879847669974).withLatitude(48.25330383601299)
.withRange(440.8).withTilt(8.3).withHeading(2.7);
Point point = KmlFactory.createPoint();
point.addToCoordinates("-90.86948943473118,48.25450093195546,0");
point.setExtrude(false);
point.setAltitudeMode(AltitudeMode.CLAMP_TO_GROUND);
point.addToCoordinates("9.444652669565212,51.30473589438118,0");
placemark.setGeometry(point);
kml.setFeature(placemark);
JAXBContext jc = JAXBContext.newInstance("HelloKml.class");
Unmarshaller u = jc.createUnmarshaller();
Kml kml3 = (Kml) u.unmarshal(new File("HelloKml.xml"));
Marshaller m = jc.createMarshaller();
StringWriter sw = new StringWriter();
m.marshal(kml3, sw);
}
}
]