When tomcat starts in service mode, it will call tomcat52.exe to start tomcat. By default, tomcat5w.exe uses java runtime as vm, and the vm will use its own JAVA_HOME setting which is stored in system registry data. For example, when you use JDK 1.4.2_06, java_home can be found in HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit\1.4.2_06. Its default value is "C:\Program Files\Java\j2re1.4.2_06" which is java run time directory. You can change this to point to JDK home directory, like "C:\j2sdk1.4.2_06".
In java, we have two operations (" == " and " equals() ") to check the equivalence of String s. It is important to understand that the difference between them. == The == operator compares the two objects and checks to see if two objects are exactly the same object (refer to the same instance). .equals() The equals() method compares the characters in the two different objects. Two strings may be different objects , but can contains the same values (exactly the same characters). public class Main { public static void main(String[] args) { String s1 = "Shangshu"; String s2 = new String(s1); System.out.println(s1 + " == " + s2 + " is " + (s1 == s2)); System.out.println(s1 + ".equals(" + s2 + ") is " + (s1.equals(s2))); } } The output of the above code is:...
Comments