Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8357138

Unable to run Java programs because of UnsatisfiedLinkError

XMLWordPrintable

    • generic
    • windows

      ADDITIONAL SYSTEM INFORMATION :
      Device Name DESKTOP-5QB0TFB
      Processor Intel(R) Core(TM) i7-4510U CPU @ 2.00GHz 2.60 GHz
      Installed RAM 8.00 GB (7.89 GB usable)
      Storage 238 GB SSD SSD
      Graphics Card AMD Radeon R7 M265 (2 GB), Intel(R) HD Graphics Family (113 MB)
      Device ID A2A674BE-C3CC-4CA1-BD21-64F1C80C0AB6
      Product ID 00327-60000-00000-AA838
      System Type 64-bit operating system, x64-based processor
      Pen and touch Touch support with 10 touch points


      A DESCRIPTION OF THE PROBLEM :
      Installed multiple versions of JDK one by one but unable to run a simple Hello World java program and unable to install applications such as NetBeans. When I use cmd and javac to compile a program it gives the UnsatisfiedLinkError and that net.dll is already loaded in another class loader. Path and everything else is set correctly, I have worked with Java for many years and this is the first time I am encountering this

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. install jdk 17/21/23 any one
      2. write a simple Hello World program
      3. run using cmd and javac

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      That java would run properly
      ACTUAL -
      An exception has occurred in the compiler (23.0.2). Please file a bug against the Java compiler via the Java bug reporting page (https://bugreport.java.com) after checking the Bug Database (https://bugs.java.com) for duplicates. Include your program, the following diagnostic, and the parameters passed to the Java compiler in your report. Thank you.
      java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\Java\jdk-23\bin\net.dll already loaded in another classloader
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:167)
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
              at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259)
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:249)
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:234)
              at java.base/jdk.internal.loader.BootLoader.loadLibrary(BootLoader.java:149)
              at java.base/sun.nio.ch.IOUtil.<clinit>(IOUtil.java:612)
              at java.base/sun.nio.ch.FileDispatcherImpl.<clinit>(FileDispatcherImpl.java:190)
              at java.base/sun.nio.ch.FileChannelImpl.<clinit>(FileChannelImpl.java:75)
              at java.base/sun.nio.fs.WindowsChannelFactory.newFileChannel(WindowsChannelFactory.java:169)
              at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:229)
              at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
              at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
              at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
              at java.base/java.nio.file.Files.newInputStream(Files.java:160)
              at jdk.compiler/com.sun.tools.javac.file.PathFileObject.openInputStream(PathFileObject.java:443)
              at jdk.compiler/com.sun.tools.javac.file.PathFileObject.getCharContent(PathFileObject.java:466)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSource(JavaCompiler.java:618)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:690)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1041)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler$InitialFileParser.parse(JavaCompiler.java:1975)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1028)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:950)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
              at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
              at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
      Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class sun.nio.ch.FileChannelImpl
              at java.base/sun.nio.fs.WindowsChannelFactory.newFileChannel(WindowsChannelFactory.java:169)
              at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:229)
              at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:482)
              at java.base/java.nio.file.Files.newOutputStream(Files.java:228)
              at java.base/java.nio.file.Files.newBufferedWriter(Files.java:3012)
              at java.base/java.nio.file.Files.newBufferedWriter(Files.java:3060)
              at jdk.compiler/com.sun.tools.javac.main.Main.printArgumentsToFile(Main.java:379)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:361)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:178)
              at jdk.compiler/com.sun.tools.javac.Main.compile(Main.java:66)
              at jdk.compiler/com.sun.tools.javac.Main.main(Main.java:52)
      Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.UnsatisfiedLinkError: Native Library C:\Program Files\Java\jdk-23\bin\net.dll already loaded in another classloader [in thread "main"]
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:167)
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:139)
              at java.base/jdk.internal.loader.NativeLibraries.findFromPaths(NativeLibraries.java:259)
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:249)
              at java.base/jdk.internal.loader.NativeLibraries.loadLibrary(NativeLibraries.java:234)
              at java.base/jdk.internal.loader.BootLoader.loadLibrary(BootLoader.java:149)
              at java.base/sun.nio.ch.IOUtil.<clinit>(IOUtil.java:612)
              at java.base/sun.nio.ch.FileDispatcherImpl.<clinit>(FileDispatcherImpl.java:190)
              at java.base/sun.nio.ch.FileChannelImpl.<clinit>(FileChannelImpl.java:75)
              at java.base/sun.nio.fs.WindowsChannelFactory.newFileChannel(WindowsChannelFactory.java:169)
              at java.base/sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:229)
              at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
              at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
              at java.base/java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:420)
              at java.base/java.nio.file.Files.newInputStream(Files.java:160)
              at jdk.compiler/com.sun.tools.javac.file.PathFileObject.openInputStream(PathFileObject.java:443)
              at jdk.compiler/com.sun.tools.javac.file.PathFileObject.getCharContent(PathFileObject.java:466)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.readSource(JavaCompiler.java:618)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parse(JavaCompiler.java:690)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1041)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler$InitialFileParser.parse(JavaCompiler.java:1975)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.parseFiles(JavaCompiler.java:1028)
              at jdk.compiler/com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:950)
              at jdk.compiler/com.sun.tools.javac.main.Main.compile(Main.java:319)
              ... 3 more

      ---------- BEGIN SOURCE ----------
      public class HelloWorld {
          public static void main(String[] args) {
              System.out.println("Hello, world!");
          }
      }
      ---------- END SOURCE ----------

            asajeev Anjana Sajeev
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: