c-stranger c-stranger - 19 days ago 6
Java Question

missing java package ome.units

Sorry I'm completely new to java.
A java file referenced ome.units.UNITS, when I loaded the file I had warning "package ome.units" doesn't exist.
I'm curious, does the package ome.units belong to system or user implementation?
I googled ome.units but had no luck to find any helpful info.

Answer

You need to include/import the following dependency as Jon Skeet pointed out:

The ome-xml project contains the package ome.units.

You have a couple options…

Maven

<dependency>
    <groupId>org.openmicroscopy</groupId>
    <artifactId>ome-xml</artifactId>
    <version>5.3.1</version>
</dependency>

Gradle

compile 'org.openmicroscopy:ome-xml:5.3.1'

Download

  1. Open Microscopy | Support | ome-xml | Download
  2. Open Microscopy | Bio Formats 5.2.4
  3. Bio-Formats components downloads
  4. OME-XML Java library | ome-xml.jar

Here is the source code via GitHub.