2

I am migrating a project from Java 8 to OpenJDK 11. Some code is still using sun.misc.VM. When I try to compile it by adding the exports from the jdk.unsupported module, I get the following error:

javac --add-exports jdk.unsupported/sun.misc=ALL-UNNAMED C:\mypath\mysoure.java
    C:\mypath\mysoure.java:32: error: cannot find symbol
    import sun.misc.VM;
                   ^
      symbol:   class VM
      location: package sun.misc

Also when I browse through the jdk.unsupported.jmod file, I can't find VM under the classes\sun\misc\ path. Is it really gone ore maybe still contained in another module?

mabu
  • 311
  • 2
  • 6
  • From my knowledge `sun` pack it is from `Oracle`. `OpenJDK` don't contains libraries from `Oracle`, atleast in `OpenJDK 11`. – KunLun Feb 08 '19 at 16:35
  • 1
    What do you need this class for? Have you looked into an alternative? – VGR Feb 08 '19 at 16:37
  • @VGR: As an integrator I want to get a huge code base through the build first. It's not my code. Need to get an overview first, what kind of changes are required as part of Java 11 migration. Might run across a number of other issues during the build. Still analysing on the actual migration plan. – mabu Feb 08 '19 at 16:45
  • @KunLun : OpenJDK still contains e. g. sun.misc.Signal in the same module. – mabu Feb 08 '19 at 16:47
  • 2
    Read [this](https://stackoverflow.com/questions/53543062/replace-access-to-sun-misc-vm-for-jdk-11) – MarsAtomic Feb 08 '19 at 18:19

0 Answers0