J2SE 5.0 Update 5 on XP

Hi, I'm following the instructions to Core Java2 Volume I and loadded the j2se version 5 with update 5. I assumed this was inclusive of all patches. My java -version ran well. When compiling Welcome.java into bit code, I have a compiler exception <1.5.0_02>. Was the download inclusive of all patches or what should I have done. test follow: C:\corejava\v1\v1ch2\Welcome>java -version

java version"1.5.0_05"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)

Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

C:\corejava\v1\v1ch2\Welcome>javac Welcome.java

An exception has occurred in the compiler (1.5.0_02). Please file a bug at the J

ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking

the Bug Paradefor duplicates. Include your program and the following diagnosti

c in your report. Thank you.

java.lang.InternalError: jzentry == 0,

jzfile = 2542632,

total = 382,

name = C:\Sun\AppServer\jdk\jre\lib\jsse.jar,

i = 2,

message = invalid LOC header (bad signature)

at java.util.zip.ZipFile$3.nextElement(ZipFile.java:430)

at java.util.zip.ZipFile$3.nextElement(ZipFile.java:416)

at com.sun.tools.javac.jvm.ClassReader.openArchive(ClassReader.java:1442

)

at com.sun.tools.javac.jvm.ClassReader.list(ClassReader.java:1719)

at com.sun.tools.javac.jvm.ClassReader.listAll(ClassReader.java:1859)

at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1873)

at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1521)

at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)

at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:249)

at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:386)

at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:214)

at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:228)

at com.sun.tools.javac.comp.Enter.complete(Enter.java:441)

at com.sun.tools.javac.comp.Enter.main(Enter.java:426)

at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:413)

at com.sun.tools.javac.main.Main.compile(Main.java:592)

at com.sun.tools.javac.main.Main.compile(Main.java:544)

at com.sun.tools.javac.Main.compile(Main.java:67)

at com.sun.tools.javac.Main.main(Main.java:52)

C:\corejava\v1\v1ch2\Welcome >more Welcome.java

/**

@version 1.20 2004-02-28

@author Cay Horstmann

*/

publicclass Welcome

{

publicstaticvoid main(String[] args)

{

String[] greeting =new String[3];

greeting[0] ="Welcome to Core Java";

greeting[1] ="by Cay Horstmann";

greeting[2] ="and Gary Cornell";

for (String g : greeting)

System.out.println(g);

}

}

I also should note that I had previuosly used version 1.4.2 and on my Xp machine had a PATH that also had the jre/bin and sun/.. and I removed them and started building up. First with just c:/jdk1.5.0_05/bin

Next I added c;/jre1.5.0_05 and the c:/jdk1.5.0_05/jre/bin

Path setting 'C:\jdk1.5.0_05\bin;C:\jdk1.5.0_05\bin\jre\bin;C:\jre1.5.0_05\bin;C:\java_class '

and running javac with -classpath . with the same results

[3872 byte] By [zachstevea] at [2007-10-2 2:01:08]
# 1
I assume I missed a download and the issue is with: C:\Sun\AppServer\jdk\jre\lib\jsse.jar,My Sun\AppsServer must need to be updated, I'll go fish, but any replies of the download link would be greatly appreciate.
zachstevea at 2007-7-15 19:42:23 > top of Java-index,Administration Tools,Sun Connection...
# 2

I can't help you out directly, but it might be interesting to fix the syntax problem with your for loop to see if it compiles correctly. The for loop should be something likefor(int i = 0;i<greeting.length;i++)

System.out.println(greeting[i]);

>

atmguya at 2007-7-15 19:42:23 > top of Java-index,Administration Tools,Sun Connection...
# 3

I went to the sun site and under popular downloads, I selected j2se 5.0 and then selected Update 5.0.

I went back and noticed the following bundle and now curious if the C;\Su\AppServer folder area updated by 'Sun Java System Application Server Platform Edition 8.1 2005Q2 UR2 ' ?

On a related note if I can just select this and have it overwrite?

I may do this in a bit.

J2EE 1.4 SDK 2005Q2 UR2

(117-142 MB)

Contains:

Sun Java System Application Server Platform Edition 8.1 2005Q2 UR2

J2SE 5.0

J2EE 1.4 SDK Samples 2005Q2 UR2

J2EE 1.4 API Documentation

zachstevea at 2007-7-15 19:42:23 > top of Java-index,Administration Tools,Sun Connection...
# 4
I believe the for loop is a version 5 ehancement along with generic classes and xml validation.
zachstevea at 2007-7-15 19:42:23 > top of Java-index,Administration Tools,Sun Connection...
# 5

Still same error with no luck. I did download the bundle and it would have updated the C:\Sun\AppServer area, but I was warned about a previous install and need to uninstall or select another directory so i added a '2' and make c:\Sun2\AppServer. No luck.

I continued to gues at my path environment variable and the install added the entriy C:\Sun2\AppServer\bin and

Any suggestions?

Current built up path.

C:\Sun2\AppServer\bin;C:\jdk1.5.0_05\bin;C:\jdk1.5.0_05\bin\jre\bin;C:\jre1.5.0_05\bin;C:\java_class

zachstevea at 2007-7-15 19:42:23 > top of Java-index,Administration Tools,Sun Connection...
# 6

No, you can't install a new Java download over an existing one. Sun's JRE does have an update capability, but that's the JRE only - not the JDk, and only if invoked via the methods from the Java plugin. Install new downloads of either the JRE or the JDK into clean directories.

Your problems may be due to what appears to a mix of Java versions. While the jvm (runtime) versions is 1.5.0_05, the javac versions appears to be 1.5.0_02, as can be seen:

C:\corejava\v1\v1ch2\Welcome>java -version

java version "1.5.0_05"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)

Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)

C:\corejava\v1\v1ch2\Welcome>javac Welcome.java

An exception has occurred in the compiler (1.5.0_02). Please file a bug at the J

ChuckBinga at 2007-7-15 19:42:23 > top of Java-index,Administration Tools,Sun Connection...