44 import sun.security.util.SecurityConstants; |
44 import sun.security.util.SecurityConstants; |
45 import sun.reflect.annotation.AnnotationType; |
45 import sun.reflect.annotation.AnnotationType; |
46 import jdk.internal.HotSpotIntrinsicCandidate; |
46 import jdk.internal.HotSpotIntrinsicCandidate; |
47 import jdk.internal.misc.JavaLangAccess;; |
47 import jdk.internal.misc.JavaLangAccess;; |
48 import jdk.internal.misc.SharedSecrets;; |
48 import jdk.internal.misc.SharedSecrets;; |
|
49 import jdk.internal.misc.VM; |
49 import jdk.internal.logger.LoggerFinderLoader; |
50 import jdk.internal.logger.LoggerFinderLoader; |
50 import jdk.internal.logger.LazyLoggers; |
51 import jdk.internal.logger.LazyLoggers; |
51 import jdk.internal.logger.LocalizedLoggerWrapper; |
52 import jdk.internal.logger.LocalizedLoggerWrapper; |
52 |
53 |
53 /** |
54 /** |
1815 // from the properties set by the VM. If the properties are for |
1816 // from the properties set by the VM. If the properties are for |
1816 // internal implementation use only, these properties should be |
1817 // internal implementation use only, these properties should be |
1817 // removed from the system properties. |
1818 // removed from the system properties. |
1818 // |
1819 // |
1819 // See java.lang.Integer.IntegerCache and the |
1820 // See java.lang.Integer.IntegerCache and the |
1820 // sun.misc.VM.saveAndRemoveProperties method for example. |
1821 // VM.saveAndRemoveProperties method for example. |
1821 // |
1822 // |
1822 // Save a private copy of the system properties object that |
1823 // Save a private copy of the system properties object that |
1823 // can only be accessed by the internal implementation. Remove |
1824 // can only be accessed by the internal implementation. Remove |
1824 // certain system properties that are not intended for public access. |
1825 // certain system properties that are not intended for public access. |
1825 sun.misc.VM.saveAndRemoveProperties(props); |
1826 VM.saveAndRemoveProperties(props); |
1826 |
1827 |
1827 |
1828 |
1828 lineSeparator = props.getProperty("line.separator"); |
1829 lineSeparator = props.getProperty("line.separator"); |
1829 sun.misc.Version.init(); |
1830 sun.misc.Version.init(); |
1830 |
1831 |
1844 |
1845 |
1845 // Initialize any miscellaneous operating system settings that need to be |
1846 // Initialize any miscellaneous operating system settings that need to be |
1846 // set for the class libraries. Currently this is no-op everywhere except |
1847 // set for the class libraries. Currently this is no-op everywhere except |
1847 // for Windows where the process-wide error mode is set before the java.io |
1848 // for Windows where the process-wide error mode is set before the java.io |
1848 // classes are used. |
1849 // classes are used. |
1849 sun.misc.VM.initializeOSEnvironment(); |
1850 VM.initializeOSEnvironment(); |
1850 |
1851 |
1851 // The main thread is not added to its thread group in the same |
1852 // The main thread is not added to its thread group in the same |
1852 // way as other threads; we must do it ourselves here. |
1853 // way as other threads; we must do it ourselves here. |
1853 Thread current = Thread.currentThread(); |
1854 Thread current = Thread.currentThread(); |
1854 current.getThreadGroup().add(current); |
1855 current.getThreadGroup().add(current); |
1855 |
1856 |
1856 // register shared secrets |
1857 // register shared secrets |
1857 setJavaLangAccess(); |
1858 setJavaLangAccess(); |
1858 |
1859 |
1859 // Subsystems that are invoked during initialization can invoke |
1860 // Subsystems that are invoked during initialization can invoke |
1860 // sun.misc.VM.isBooted() in order to avoid doing things that should |
1861 // VM.isBooted() in order to avoid doing things that should |
1861 // wait until the application class loader has been set up. |
1862 // wait until the application class loader has been set up. |
1862 // IMPORTANT: Ensure that this remains the last initialization action! |
1863 // IMPORTANT: Ensure that this remains the last initialization action! |
1863 sun.misc.VM.booted(); |
1864 VM.booted(); |
1864 } |
1865 } |
1865 |
1866 |
1866 private static void setJavaLangAccess() { |
1867 private static void setJavaLangAccess() { |
1867 // Allow privileged classes outside of java.lang |
1868 // Allow privileged classes outside of java.lang |
1868 SharedSecrets.setJavaLangAccess(new JavaLangAccess(){ |
1869 SharedSecrets.setJavaLangAccess(new JavaLangAccess(){ |