11

JSR 275似乎处于拒绝状态。JScience似乎有一个实现,并且似乎有unitofmeasure

  1. 还有其他开源实现吗?
  2. 哪个包符合 jsr-275 且易于使用。
4

3 回答 3

13

由于 JSR-275 已被拒绝,无法使用 javax 命名空间并已被命名空间 org.unitsofmeasurement 取代。JScience实现已经发布,在撰写本文时最新版本是 2012 年 10 月的 4.3.1 版。干杯,Jean-Marie Dautelle(JScience 项目所有者)

于 2010-11-24T11:58:37.150 回答
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)

于 2015-01-21T18:21:20.827 回答
4

正如@WernerKeil 提到的,替代品似乎是JSR 363。我做了一些研究(这些东西很难找到,散落在各处,没有清晰的概述,这就是我在这里发布这个的原因),看起来你会想要引入已发布的unitofmeasurement依赖项,例如来自 Maven之类的这个:

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

然后在最终的应用程序中,您将需要一个实现,例如参考实现,例如来自 Maven

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

我还没有尝试过,但这看起来是迄今为止最有希望的。

于 2017-03-03T22:54:58.243 回答