Java Class Version Problem
By gc on Mar 21, 2009
Class com.iplanet.services.naming.WebtopNaming has unsupported major or minor version numbers, which are greater than those found in the Java Runtime Environment version 1.5.0_15
What do you think about the above error? The first reaction I guess could be that WebtopNaming class must be compiled by JDK1.6 or later. If you are not sure, want to double check, you can simply find out by reading the class file. According to The Java Virtual Machine Specification, the first 4 bytes are a magic number, 0xCAFEBABe, to identify a valid class file then the next 2 bytes identify the class format version (major and minor).
Someone wrote a simple Java code ClassVersionChecker, which is very convenient. The possible major/minor value are:
major minor Java version
45 3 1.0
45 3 1.1
46 0 1.2
47 0 1.3
48 0 1.4
49 0 1.5
50 0 1.6
Run ClassVersionChecker on my WebtopNaming shows "46 . 0". According to the table above, it is JDK1.2, how can it cause problem with JDK1.5. Some research on the net tell me that possible reasons should be the environment, which is not clean. Like somehow a JDK1.6 or later is present, or mixed with JDK1.5, or only JRE is 1.5, while other parts are of 1.6 ... It is not my machine. I don't know the answer yet
During a web ex session at the 2nd day, I saw the size of WebtopNaming.class, which was totally different from the original, about 10-20%. Do you know what? It was sent via email as attachment and the receiver used outlook to save it. Outlook, I can't believe people still uses it. The first thing I did normally when I get a new Windows machine or re-install Windows to get rid off viruses is to delete outlook from the desktop, start menu. I would like to delete IE too, but so many poorly designed web sites still exist.