What is the replacement for javax.activation package in java 9?(java 9 中 javax.activation 包的替代品是什么?)
问题描述
似乎 javax.activation 包在 Java 9 中已被弃用.Oracle 迁移指南建议在 JVM 启动期间使用 --add-modules java.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 激活框架 (JAF) 可能是您正在寻找现有包的替代方案.
JavaBeans Activation Framework (JAF) is possibly the alternative you are looking for to the existing package.
此独立版本的 JAF 使用 Java 平台模块系统自动模块 java.activation,匹配模块名在 JDK 9 中使用.未来的版本将包括完整的模块元数据.
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.
当前可用版本 因为这是 1.2.0 可以这样使用:
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'
常春藤
<dependency org="com.sun.activation" name="javax.activation" rev="1.2.0" />
                        这篇关于java 9 中 javax.activation 包的替代品是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:java 9 中 javax.activation 包的替代品是什么?
				
        
 
            
        基础教程推荐
- 不推荐使用 Api 注释的描述 2022-01-01
 - 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
 - 从 python 访问 JVM 2022-01-01
 - 大摇大摆的枚举 2022-01-01
 - 多个组件的复杂布局 2022-01-01
 - 验证是否调用了所有 getter 方法 2022-01-01
 - Java 实例变量在两个语句中声明和初始化 2022-01-01
 - Java Swing计时器未清除 2022-01-01
 - 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
 - 在 Java 中创建日期的正确方法是什么? 2022-01-01
 
    	
    	
    	
    	
    	
    	
    	
    	
						
						
						
						
						
				
				
				
				