简体   繁体   English

在将jnlp从openjdk 8迁移到openjdk 9时,JarIndexAccess无法访问类jdk.internal.util.jar.JarIndex(在java.base模块中)

[英]JarIndexAccess cannot access class jdk.internal.util.jar.JarIndex (in module java.base) in migrating jnlp from openjdk 8 to openjdk 9

We have below jnlp 我们有下面的jnlp

<?xml version="1.0" encoding="UTF-8"?>
<!-- !DOCTYPE jnlp PUBLIC "-//Sun Microsystems, Inc//DTD JNLP Descriptor 6.0//EN" "http://java.sun.com/dtd/JNLP-6.0.dtd" -->
<jnlp spec="6.0+" codebase="$$codebase" href="$$name">
<information>
  <title>Softpaint</title>
  <vendor>Advanced Business Solutions</vendor>
  <homepage href="$$name" />
  <description>Softpaint</description>
  <offline-allowed/>
</information>

<security> 
   <all-permissions/> 
</security>
<resources>
  <property name="jnlp.packEnabled" value="true"/>
  <j2se version="9+" href="http://java.sun.com/products/autodl/j2se" java-vm-args="-ea 
  --add-opens=java.base/java.lang.reflect=ALL-UNNAMED
  --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED
  --add-opens=java.base/sun.misc=ALL-UNNAMED 
  --add-opens=java.base/jdk.internal.util.jar=ALL-UNNAMED"
  initial-heap-size="128m" max-heap-size="512m" />
  <j2se version="1.8+" max-heap-size="256m">
    <resources>
      <jar href="rtwrapper.jar"/>
    </resources>
  </j2se>
  <j2se version="1.7*" max-heap-size="256m"/>  
  <jar href="e5wui-icons.jar" download="eager"/>
  <jar href="wuipsp.jar" main="true"/>
  <jar href="wuicli.jar"/>
  <jar href="wuiclires.jar"/>
  <jar href="wuisrv.jar"/>
  <jar href="wuitools.jar"/>
  <jar href="e5h5cli.jar"/>
  <package name="oracle.*" part="oracleoracle" recursive="true"/>
  <jar href="ojdbc6.jar" part="oracleoracle" download="lazy"/>
  <jar href="orai18n.jar" part="oracleoracle" download="lazy"/>
  <package name="com.ibm.db2.*" part="ibmdb2" recursive="true"/>
  <jar href="db2jcc4.jar" part="ibmdb2" download="lazy"/>
  <jar href="db2jcc_license_cisuz.jar" part="ibmdb2" download="lazy"/>
  <package name="com.microsoft.sqlserver.*" part="mssql" recursive="true"/>
  <jar href="sqljdbc4.jar" part="mssql" download="lazy"/>
  <package name="org.postgresql.*" part="postgresql" recursive="true"/>
  <jar href="postgresql-9.3-1101-jdbc41.jar" part="postgresql" download="lazy"/>
  <jar href="tools.jar"/>
  <jar href="slf4j-api.jar"/>
  <jar href="slf4j-jdk14.jar"/>
  <jar href="jcl-over-slf4j.jar"/>
  <jar href="swingx.jar"/>
</resources>
<application-desc 
    main-class="com.cedar.softpaint.ui.PersonalSoftpaint"/>
</jnlp>

Above jnlp working properly with oracle jdk 8. Now we are migrating to openjdk 9 and use icetea web to open the jnlp file on client side. 在jnlp之上,可以与Oracle jdk 8正常工作。现在,我们迁移到openjdk 9,并使用icetea web在客户端打开jnlp文件。 Added j2se version="9+" with some java-args but faces below issues as sun/misc/JarIndex Class not found. 添加了带有一些Java参数的j2se version =“ 9+”,但由于未找到sun / misc / JarIndex类而面临以下问题。 I know that this class has been removed from openjdk 9 . 我知道该类已从openjdk 9中删除。 So is it we need to use any alternate or do we have any workaround ? 那么,我们需要使用任何替代方法还是有任何解决方法?

Activate native: http://mahesh-pc:7050/e5softpaint/e5wui-icons.jar
java.lang.RuntimeException: java.lang.IllegalAccessException: class net.sourceforge.jnlp.jdk89acesses.JarIndexAccess cannot access class jdk.internal.util.jar.JarIndex (in module java.base) because module java.base does not export jdk.internal.util.jar to unnamed module @3b938003     at net.sourceforge.jnlp.jdk89acesses.JarIndexAccess.getJarIndex(JarIndexAccess.java:47)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$2.run(JNLPClassLoader.java:1340)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$2.run(JNLPClassLoader.java:1232)     at java.base/java.security.AccessController.doPrivileged(Native Method)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.activateJars(JNLPClassLoader.java:1362)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:785)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:285)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.createInstance(JNLPClassLoader.java:357)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:429)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:403)     at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:809)     at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:529)     at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:940) Caused by: java.lang.IllegalAccessException: class net.sourceforge.jnlp.jdk89acesses.JarIndexAccess cannot access class jdk.internal.util.jar.JarIndex (in module java.base) because module java.base does not export jdk.internal.util.jar to unnamed module @3b938003     at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)     at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:589)     at java.base/java.lang.reflect.Method.invoke(Method.java:556)     at net.sourceforge.jnlp.jdk89acesses.JarIndexAccess.getJarIndexImpl(JarIndexAccess.java:53)     at net.sourceforge.jnlp.jdk89acesses.JarIndexAccess.getJarIndex(JarIndexAccess.java:45)     ... 12 more 
Running jdk9+ ?
java.lang.ClassNotFoundException: sun/misc/JarIndex     at java.base/java.lang.Class.forName0(Native Method)     at java.base/java.lang.Class.forName(Class.java:292)     at net.sourceforge.jnlp.jdk89acesses.JarIndexAccess.<clinit>(JarIndexAccess.java:23)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$2.run(JNLPClassLoader.java:1340)     at net.sourceforge.jnlp.runtime.JNLPClassLoader$2.run(JNLPClassLoader.java:1232)     at java.base/java.security.AccessController.doPrivileged(Native Method)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.activateJars(JNLPClassLoader.java:1362)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.initializeResources(JNLPClassLoader.java:785)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.<init>(JNLPClassLoader.java:285)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.createInstance(JNLPClassLoader.java:357)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:429)     at net.sourceforge.jnlp.runtime.JNLPClassLoader.getInstance(JNLPClassLoader.java:403)     at net.sourceforge.jnlp.Launcher.createApplication(Launcher.java:809)     at net.sourceforge.jnlp.Launcher.launchApplication(Launcher.java:529)     at net.sourceforge.jnlp.Launcher$TgThread.run(Launcher.java:940)

JarIndex was moved in Java 9 to internal package dk.internal.util.jar.JarIndex JarIndex在Java 9中移至内部包dk.internal.util.jar.JarIndex

-import sun.misc.JarIndex; -导入sun.misc.JarIndex;

+import jdk.internal.util.jar.JarIndex; + import jdk.internal.util.jar.JarIndex;

Due to JEP 260 由于JEP 260

sun.misc.JarIndex, and its accompanying InvalidJarIndexException, are not "Critical APIs", as defined by JEP 260, so they should be moved out of sun.misc and placed into a more appropriate package where they can be encapsulated. 如JEP 260所定义,sun.misc.JarIndex及其随附的InvalidJarIndexException不是“关键API”,因此应将它们从sun.misc中移出,并放入更合适的包装中以对其进行封装。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从 Oracle JDK 迁移到 OpenJDK - Migrating to OpenJDK from Oracle JDK 我们如何使用 --patch-module 从 OpenJDK 11 覆盖 java.base/java.lang.Integer? - How can we overwrite java.base/java.lang.Integer from OpenJDK 11 using --patch-module? 无法使用修饰符“public”访问类java.nio.DirectByteBuffer(在模块java.base中)的成员 - cannot access a member of class java.nio.DirectByteBuffer (in module java.base) with modifiers “public” RuntimeException:模块 jrt.fs 和模块 java.base 中的 Package jdk.internal.jimage.decompressor - RuntimeException: Package jdk.internal.jimage.decompressor in module jrt.fs and module java.base Package jdk.internal.jimage.decompressor 在模块 jrt.fs 和模块 java.base 中 - Package jdk.internal.jimage.decompressor in both module jrt.fs and module java.base class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap') - class java.lang.String cannot be cast to class java.util.List (java.lang.String and java.util.List are in module java.base of loader 'bootstrap') class java.util.ArrayList cannot be cast to class com.patient.entity.CommentEntity (java.util.ArrayList is in module java.base of loader 'bootstrap'; - class java.util.ArrayList cannot be cast to class com.patient.entity.CommentEntity (java.util.ArrayList is in module java.base of loader 'bootstrap'; OLP CLI 错误:java.base 不会将 sun.security.util 导出到 JDK 16 下的未命名模块 - OLP CLI error: java.base does not export sun.security.util to unnamed module under JDK 16 不能转换为 java.base/java.util.Optional - cannot be cast to java.base/java.util.Optional 为什么 java.util 可以从多个模块访问:<unnamed> , java.base</unnamed> - Why java.util is accessible from more than one module : <unnamed>, java.base
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM