diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java index 465a1cae8d9..99029651bfb 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Jlink.java @@ -242,18 +242,6 @@ public final class Jlink { } } - /** - * Jlink instance constructor, if a security manager is set, the jlink - * permission is checked. - */ - @SuppressWarnings("removal") - public Jlink() { - if (System.getSecurityManager() != null) { - System.getSecurityManager(). - checkPermission(new JlinkPermission("jlink")); - } - } - /** * Build the image. * diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkPermission.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkPermission.java deleted file mode 100644 index f1725e77ee2..00000000000 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkPermission.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.tools.jlink.internal; - -import java.security.BasicPermission; - -/** - * The permission required to use jlink API. The permission target_name is - * "jlink". e.g.: permission jdk.tools.jlink.plugins.JlinkPermission "jlink"; - * - */ -public final class JlinkPermission extends BasicPermission { - - private static final long serialVersionUID = -3687912306077727801L; - - public JlinkPermission(String name) { - super(name); - } - -} diff --git a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Main.java b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Main.java index df08b2b54a4..eb743bc4dad 100644 --- a/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Main.java +++ b/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/Main.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,13 +44,7 @@ public class Main { * @param args command line arguments * @return an exit code. 0 means success, non-zero means an error occurred. */ - @SuppressWarnings("removal") public static int run(PrintWriter out, PrintWriter err, String... args) { - if (System.getSecurityManager() != null) { - System.getSecurityManager(). - checkPermission(new JlinkPermission("jlink")); - } - JlinkTask t = new JlinkTask(); t.setLog(out, err); return t.run(args);