< prev index next >

src/java.base/share/classes/java/lang/System.java

Print this page




1782      * @see     java.lang.SecurityManager#checkExit(int)
1783      * @since   1.1
1784      */
1785     @Deprecated(since="1.2", forRemoval=true)
1786     @SuppressWarnings("removal")
1787     public static void runFinalizersOnExit(boolean value) {
1788         Runtime.runFinalizersOnExit(value);
1789     }
1790 
1791     /**
1792      * Loads the native library specified by the filename argument.  The filename
1793      * argument must be an absolute path name.
1794      *
1795      * If the filename argument, when stripped of any platform-specific library
1796      * prefix, path, and file extension, indicates a library whose name is,
1797      * for example, L, and a native library called L is statically linked
1798      * with the VM, then the JNI_OnLoad_L function exported by the library
1799      * is invoked rather than attempting to load a dynamic library.
1800      * A filename matching the argument does not have to exist in the
1801      * file system.
1802      * See the JNI Specification for more details.

1803      *
1804      * Otherwise, the filename argument is mapped to a native library image in
1805      * an implementation-dependent manner.
1806      *
1807      * <p>
1808      * The call <code>System.load(name)</code> is effectively equivalent
1809      * to the call:
1810      * <blockquote><pre>
1811      * Runtime.getRuntime().load(name)
1812      * </pre></blockquote>
1813      *
1814      * @param      filename   the file to load.
1815      * @exception  SecurityException  if a security manager exists and its
1816      *             <code>checkLink</code> method doesn't allow
1817      *             loading of the specified dynamic library
1818      * @exception  UnsatisfiedLinkError  if either the filename is not an
1819      *             absolute path name, the native library is not statically
1820      *             linked with the VM, or the library cannot be mapped to
1821      *             a native library image by the host system.
1822      * @exception  NullPointerException if <code>filename</code> is
1823      *             <code>null</code>
1824      * @see        java.lang.Runtime#load(java.lang.String)
1825      * @see        java.lang.SecurityManager#checkLink(java.lang.String)
1826      */
1827     @CallerSensitive
1828     public static void load(String filename) {
1829         Runtime.getRuntime().load0(Reflection.getCallerClass(), filename);
1830     }
1831 
1832     /**
1833      * Loads the native library specified by the <code>libname</code>
1834      * argument.  The <code>libname</code> argument must not contain any platform
1835      * specific prefix, file extension or path. If a native library
1836      * called <code>libname</code> is statically linked with the VM, then the
1837      * JNI_OnLoad_<code>libname</code> function exported by the library is invoked.
1838      * See the JNI Specification for more details.

1839      *
1840      * Otherwise, the libname argument is loaded from a system library
1841      * location and mapped to a native library image in an implementation-
1842      * dependent manner.
1843      * <p>
1844      * The call <code>System.loadLibrary(name)</code> is effectively
1845      * equivalent to the call
1846      * <blockquote><pre>
1847      * Runtime.getRuntime().loadLibrary(name)
1848      * </pre></blockquote>
1849      *
1850      * @param      libname   the name of the library.
1851      * @exception  SecurityException  if a security manager exists and its
1852      *             <code>checkLink</code> method doesn't allow
1853      *             loading of the specified dynamic library
1854      * @exception  UnsatisfiedLinkError if either the libname argument
1855      *             contains a file path, the native library is not statically
1856      *             linked with the VM,  or the library cannot be mapped to a
1857      *             native library image by the host system.
1858      * @exception  NullPointerException if <code>libname</code> is




1782      * @see     java.lang.SecurityManager#checkExit(int)
1783      * @since   1.1
1784      */
1785     @Deprecated(since="1.2", forRemoval=true)
1786     @SuppressWarnings("removal")
1787     public static void runFinalizersOnExit(boolean value) {
1788         Runtime.runFinalizersOnExit(value);
1789     }
1790 
1791     /**
1792      * Loads the native library specified by the filename argument.  The filename
1793      * argument must be an absolute path name.
1794      *
1795      * If the filename argument, when stripped of any platform-specific library
1796      * prefix, path, and file extension, indicates a library whose name is,
1797      * for example, L, and a native library called L is statically linked
1798      * with the VM, then the JNI_OnLoad_L function exported by the library
1799      * is invoked rather than attempting to load a dynamic library.
1800      * A filename matching the argument does not have to exist in the
1801      * file system.
1802      * See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
1803      * for more details.
1804      *
1805      * Otherwise, the filename argument is mapped to a native library image in
1806      * an implementation-dependent manner.
1807      *
1808      * <p>
1809      * The call <code>System.load(name)</code> is effectively equivalent
1810      * to the call:
1811      * <blockquote><pre>
1812      * Runtime.getRuntime().load(name)
1813      * </pre></blockquote>
1814      *
1815      * @param      filename   the file to load.
1816      * @exception  SecurityException  if a security manager exists and its
1817      *             <code>checkLink</code> method doesn't allow
1818      *             loading of the specified dynamic library
1819      * @exception  UnsatisfiedLinkError  if either the filename is not an
1820      *             absolute path name, the native library is not statically
1821      *             linked with the VM, or the library cannot be mapped to
1822      *             a native library image by the host system.
1823      * @exception  NullPointerException if <code>filename</code> is
1824      *             <code>null</code>
1825      * @see        java.lang.Runtime#load(java.lang.String)
1826      * @see        java.lang.SecurityManager#checkLink(java.lang.String)
1827      */
1828     @CallerSensitive
1829     public static void load(String filename) {
1830         Runtime.getRuntime().load0(Reflection.getCallerClass(), filename);
1831     }
1832 
1833     /**
1834      * Loads the native library specified by the <code>libname</code>
1835      * argument.  The <code>libname</code> argument must not contain any platform
1836      * specific prefix, file extension or path. If a native library
1837      * called <code>libname</code> is statically linked with the VM, then the
1838      * JNI_OnLoad_<code>libname</code> function exported by the library is invoked.
1839      * See the <a href="{@docRoot}/../specs/jni/index.html"> JNI Specification</a>
1840      * for more details.
1841      *
1842      * Otherwise, the libname argument is loaded from a system library
1843      * location and mapped to a native library image in an implementation-
1844      * dependent manner.
1845      * <p>
1846      * The call <code>System.loadLibrary(name)</code> is effectively
1847      * equivalent to the call
1848      * <blockquote><pre>
1849      * Runtime.getRuntime().loadLibrary(name)
1850      * </pre></blockquote>
1851      *
1852      * @param      libname   the name of the library.
1853      * @exception  SecurityException  if a security manager exists and its
1854      *             <code>checkLink</code> method doesn't allow
1855      *             loading of the specified dynamic library
1856      * @exception  UnsatisfiedLinkError if either the libname argument
1857      *             contains a file path, the native library is not statically
1858      *             linked with the VM,  or the library cannot be mapped to a
1859      *             native library image by the host system.
1860      * @exception  NullPointerException if <code>libname</code> is


< prev index next >