diff --git a/build.sbt b/build.sbt index 284a4c1813335..5091cb4cbe768 100644 --- a/build.sbt +++ b/build.sbt @@ -1107,10 +1107,7 @@ lazy val `project-manager` = (project in file("lib/scala/project-manager")) staticOnLinux = true, initializeAtRuntime = Seq( "scala.util.Random", - "sun.awt", - "sun.java2d", - "sun.font", - "java.awt", + "com.sun.jna", "zio.internal.ZScheduler$$anon$4", "zio.Runtime$", "zio.FiberRef$" diff --git a/lib/java/desktop-environment/src/main/java/org/enso/desktopenvironment/JnaTrash.java b/lib/java/desktop-environment/src/main/java/org/enso/desktopenvironment/JnaTrash.java index 383a05e983bb6..d3015b521ff7d 100644 --- a/lib/java/desktop-environment/src/main/java/org/enso/desktopenvironment/JnaTrash.java +++ b/lib/java/desktop-environment/src/main/java/org/enso/desktopenvironment/JnaTrash.java @@ -1,24 +1,22 @@ package org.enso.desktopenvironment; +import com.sun.jna.platform.FileUtils; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import com.sun.jna.platform.FileUtils; final class JnaTrash implements Trash { - private static final FileUtils fileUtils = FileUtils.getInstance(); - @Override public boolean isSupported() { - return fileUtils.hasTrash(); + return FileUtils.getInstance().hasTrash(); } @Override public boolean moveToTrash(Path path) { if (Files.exists(path) && isSupported()) { try { - fileUtils.moveToTrash(path.toFile()); + FileUtils.getInstance().moveToTrash(path.toFile()); return true; } catch (IOException ignored) {