Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

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?

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
933 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

This standalone release of JAF uses a Java Platform Module System automatic module name of java.activation, to match the module name used in JDK 9. A future version will include full module metadata.

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.


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

Maven

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

Gradle

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

Ivy

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...