我有一个OSGI应用程序,大约有30个捆绑包(jar文件)。今天我决定测试一下它是否能在Java 9上工作。
然后我启动了我的应用程序并得到了以下信息:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.apache.felix.framework.util.SecureAction (file:/home/.../jar/org.apache.felix.framework-5.4.0.jar) to method java.net.URLClassLoader.addURL(java.net.URL)
WARNING: Please consider reporting this to the maintainers of org.apache.felix.framework.util.SecureAction
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
阅读一些内容后,我添加了命令行选项
--add-exports java.base/java.net=org.apache.felix.framework
并创建了名为module-info.java的文件,其内容如下:
module org.apache.felix.framework { }
我有两个问题。我应该将这个module-info.java放在哪里才能让jvm读取它?我应该如何将这个module-info与org.apache.felix.framework-5.4.0.jar
文件/捆绑/ jar?
如果我做错了,请指出我正确的方向来解决这个问题。