PageRank verified www.micromata.de/

Java API for KML - FAQ

JAK? What does this stand for?

JAK is short for: Java API for KML

JAK! But why?

The main goal of the Java API for KML (JAK) is to provide automatically generated full reference implementation of the KML object model defined by OGC's KML standard and Google's GX extensions. It is an object orientated API that enables the convenient and easy use of KML in existing Java environments.

Missing something? More questions?

Take a look at at JAK's discussion group: http://groups.google.com/group/javaapiforkml.

Missing something? Found an error?

Take a look at the Roadmap or post it here: http://code.google.com/p/xjcpluginjavaapiforkml/issues/list.

NoClassDefFoundError?

JAK only works if all dependencies are resolved! This is mainly JAXB! JAXB needed to be downloaded and the containing JARs put into the classpath.
Version 2.1.xx of JAXB should be fine.

After downloading JAXB 2.1.xx (or a later version) the jar needed to be executed with this command: java -jar JAXB2_200xxxxx.jar
or on Windows or Mac, a double-click on the jar file will execute it.

In the next step accept the license contract (if you agree) and take a look in the jaxb-ri-200xxxxx/bin folder. From there copy these files to you own lib folder in your JAK project:

  • activation.jar
  • jaxb-api.jar
  • jaxb-impl.jar
  • jsr173_1.0_api
  • (optional: the jaxb-xjc.jar, if you like to use the XJCPluginJavaApiforKml as well)

These file need to be put into the classpath and all should be fine.

Alternatively JAK can be found in the official dev.java.net Maven 2 repository:

Listing 1: JAK at maven2-repository.dev.java.net
<dependencies>
    ...
   <!-- The Java API for KML -->
   <dependency>
      <groupId>de.micromata.jak</groupId>
      <artifactId>JavaAPIforKml</artifactId>
      <version>2.2.0-SNAPSHOT</version>
   </dependency>
    ...
</dependencies>
<repositories>
    ...
   <repository>
      <id>maven2-repository.dev.java.net</id>
      <name>Java.net Maven 2 Repository</name>
      <url>http://download.java.net/maven/2</url>
      <layout>default</layout>
      <snapshots>
         <enabled>true</enabled>
      </snapshots>
      </repository>
</repositories>

JAK vs. libkml

JAK and libKML are very similar and yet fundamentally different. This is in spite of the fact that JAK is written natively in Java and libkml is offered in C++. Both implement the current OGC KML 2.2 standard as well as Google's Gx extensions. In contrast to libkml or especially C++, no memory management is needed. Java's garbage collector does all of this.
While each class of libkml is carefully handcrafted, all of the JAK's code is autogenerated. As a result, changes to OGC's KML schema specification can be added to JAK rapidly. They are not competing with each other. Their purpose is to parse, generate, process, and save KML data in a programmatic manner.

The difference between Java API for KML and XJCPluginJavaApiforKml

The Java API for KML is the result of the XJCPluginJavaApiforKml. In other words: The XJCPluginJavaApiforKml creates the Java API for KML.
Java API for KML is documented at HelloKML (Quickstart), KML in the Java world, and Usage.
XJCPluginJavaApiforKml is documented at JAK's API approach and Implementation.

Figure 1: The difference between Java API for KML and XJCPluginJavaApiforKml.

Searching JAK

Java API for KML | @Google

Browse Space

Explore Confluence

Your Account

Add Content

Labsfooter  is the OpenSource platform of www.micromata.de | Imprint