title: Saving an H2O model directly from Java
body: <p>I'm trying to create and save a generated model directly from Java. The <a href="https://h2o-release.s3.amazonaws.com/h2o/rel-slater/5/docs-website/h2o-genmodel/javadoc/index.html" rel="nofollow noreferrer">documentation</a> specifies how to do this in R and Python, but not in Java. A similar <a href="https://stackoverflow.com/questions/33909907/can-i-use-directly-h2o-library-functions-from-java-or-the-only-option-for-h2o-is">question</a> was asked before, but no real answer was provided (beyond linking to H2O doc, which doesn't contain a code example).</p>
  
  <p>It'd be sufficient for my present purpose get some pointers to be able to translate the following reference code to Java. I'm mainly looking for guidance on the relevant JAR(s) to import from the <a href="http://search.maven.org/#search%7Cga%7C1%7Cai.h2o" rel="nofollow noreferrer">Maven repository</a>. </p>
  
  <pre><code>import h2o
  h2o.init()
  path = h2o.system_file("prostate.csv")
  h2o_df = h2o.import_file(path)
  h2o_df['CAPSULE'] = h2o_df['CAPSULE'].asfactor()
  model = h2o.glm(y = "CAPSULE",
              x = ["AGE", "RACE", "PSA", "GLEASON"],
              training_frame = h2o_df,
              family = "binomial")
  h2o.download_pojo(model)
  </code></pre>