本文介绍了java 9中javax.activation包的替代品是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎 javax.activation 在Java 9中不推荐使用。
Oracle迁移指南建议使用 - add-modules java JVM启动期间的.activation 选项。

Seems like javax.activation package is deprecated in Java 9.Oracle migration guide proposes to use --add-modules java.activation option during JVM start.

但是,我想避免这种情况并替换 javax.activation 包的类,因为它已弃用,并且将来的java版本中删除。我想, javax.activation 应该有某种替代方案。如果有可用的,它是什么?

However, I would like to avoid this and replace javax.activation package's classes, as it is deprecated and will be removed in future java versions. I suppose, there should be some kind of alternative for javax.activation. If there is any available, what is it?

推荐答案

可能是您正在寻找现有软件包的替代方案。

JavaBeans Activation Framework (JAF) is possibly the alternative you are looking for to the existing package.

独立API仅以模块形式支持,通过 。使用它们,可以在任何阶段使用该模块的版本,即在编译时,构建时或运行时。

The standalone APIs are supported in modular form only, via the concept of upgradeable modules. Using them, it's possible to use a version of that module from a later release in any phase, i.e., at compile time, build time, or runtime.

目前为 1.2.0 ,可以这样使用:

The currently available version for this is 1.2.0 which can be used like this:

Maven

Maven

<dependency>
    <groupId>com.sun.activation</groupId>
    <artifactId>javax.activation</artifactId>
    <version>1.2.0</version>
</dependency>

Gradle

Gradle

compile 'com.sun.activation:javax.activation:1.2.0'

Ivy

Ivy

<dependency org="com.sun.activation" name="javax.activation" rev="1.2.0" />

这篇关于java 9中javax.activation包的替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-16 14:35
查看更多