Which jsr-275 units implementation should be used? [closed]
Asked Answered
J

3

11

JSR 275 seems to be in a rejected state. JScience seems to have an implementation and there seems to be unitsofmeasure.

  1. Are there any other open source implementations?
  2. Which package is jsr-275 compliant and easy to use.
Jacquie answered 19/11, 2010 at 10:28 Comment(0)
C
13

Since the JSR-275 has been rejected the javax namespace cannot be used and has been replaced by the namespace org.unitsofmeasurement. The JScience implementation has been released, latest as of this writing is version 4.3.1 in Oct 2012. Cheers, Jean-Marie Dautelle (JScience project owner)

Canadianism answered 24/11, 2010 at 11:58 Comment(1)
any update on when JScience will be released? I searched maven.java.net but only found a POM for the 5.0-SNAPSHOT version.Irena
S
7

While JScience also plans to implement it at some point, please note JSR 363, the new Units of Measurement standard for Java (successor to JSR 275) is available in Early Draft stage, see http://unitsofmeasurement.github.io/ You'll also find the API and RI in places like MavenCentral.

Werner (Co Spec Lead, JSR 363)

Stromberg answered 21/1, 2015 at 18:21 Comment(0)
S
4

As @WernerKeil mentioned, the replacement seems to be JSR 363. I did a bit of research (this stuff is hard to find, scattered around everywhere with no clear overview, which is why I post this here) and it appears that you'll want to bring in the released unitofmeasurement dependency, e.g. from Maven like this:

<dependency>
  <groupId>javax.measure</groupId>
  <artifactId>unit-api</artifactId>
  <version>1.0</version>
</dependency>

Then in the final application you'll want an implementation, such as the reference implementation, e.g. from Maven:

<dependency>
  <groupId>tec.units</groupId>
  <artifactId>unit-ri</artifactId>
  <version>1.0.2</version>
</dependency>

I haven't tried this yet, but that looks the most promising so far.

Shipmate answered 3/3, 2017 at 22:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.