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".
HOW TO FIX IT: It is because eventhough you have Java 5 installed, the JVM running may be different. Try typing this in the console window: java -version. It will give you the Version of the Runtime Environment. Or, if you are using an IDE, then you need to enable Java 5 support. In Eclipse, You can add Java 5 in Window > Preferences > Java > Installed JRE’s. and/or, Set the compiler compliance level to 5.0 (Window > Preferences > Java > Compiler) In Netbeans, you can use (Tools -> Java Platform Manager) to check your default platform. If you use javac commond line, try: javac -1.5 xxx.java Reference: http://laksmono.wordpress.com/2007/05/27/syntax-error-parameterized-types-are-only-available-if-source-level-is-50/
Comments