diff --git a/native-sql-engine/core/src/main/java/com/intel/oap/vectorized/JniUtils.java b/native-sql-engine/core/src/main/java/com/intel/oap/vectorized/JniUtils.java index 565c1dff9..4579be179 100644 --- a/native-sql-engine/core/src/main/java/com/intel/oap/vectorized/JniUtils.java +++ b/native-sql-engine/core/src/main/java/com/intel/oap/vectorized/JniUtils.java @@ -82,7 +82,8 @@ private JniUtils(String _tmp_dir) throws IOException, IllegalAccessException, Il } else { Path folder = Paths.get(_tmp_dir); Path path = Files.createTempDirectory(folder, "spark_columnar_plugin_"); - FileUtils.forceDeleteOnExit(new File(path.toUri())); + Runtime.getRuntime().addShutdownHook( + new Thread(() -> FileUtils.deleteQuietly(path.toFile()))); tmp_dir = path.toAbsolutePath().toString(); } }