• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Arrg! Can't compile anything!

 
Brian Emch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using Windows XP OS SP2 and just installed jdk1.5.0_06. I just finished the "Head First Java" book (which was excellent) and had no problems with any compiling throughout the whole book on an old computer. My new (used by someone prior to me) computer will not compile anything. None of the applications I compiled will work either.

Here is what happens when I attempt to compile:

C:\javabook\gui>javac TwoButtons.java
An exception has occurred in the compiler (1.5.0_06). Please file a bug at the J
ava Developer Connection (http://java.sun.com/webapps/bugreport) after checking
the Bug Parade for duplicates. Include your program and the following diagnosti
c in your report. Thank you.
java.lang.InternalError: jzentry == 0,
jzfile = 2591288,
total = 12932,
name = C:\Program Files\Java\jdk1.5.0_06\jre\lib\rt.jar,
i = 4929,
message = invalid LOC header (bad signature)
at java.util.zip.ZipFile$3.nextElement(ZipFile.java:429)
at java.util.zip.ZipFile$3.nextElement(ZipFile.java:415)
at com.sun.tools.javac.jvm.ClassReader.openArchive(ClassReader.java:1447
)
at com.sun.tools.javac.jvm.ClassReader.list(ClassReader.java:1742)
at com.sun.tools.javac.jvm.ClassReader.listAll(ClassReader.java:1882)
at com.sun.tools.javac.jvm.ClassReader.fillIn(ClassReader.java:1901)
at com.sun.tools.javac.jvm.ClassReader.complete(ClassReader.java:1538)
at com.sun.tools.javac.code.Symbol.complete(Symbol.java:355)
at com.sun.tools.javac.comp.Enter.visitTopLevel(Enter.java:256)
at com.sun.tools.javac.tree.Tree$TopLevel.accept(Tree.java:382)
at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:221)
at com.sun.tools.javac.comp.Enter.classEnter(Enter.java:235)
at com.sun.tools.javac.comp.Enter.complete(Enter.java:448)
at com.sun.tools.javac.comp.Enter.main(Enter.java:433)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:403)
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)

When I try to run the program I get:
C:\javabook\gui>java TwoButtons
Exception in thread "main" java.lang.NoClassDefFoundError: TwoButtons

The above works fine on my old PC.

I've installed and uninstalled the JDK several times with no luck. I'm ready to start he Servlets and JSP book, but I need to get java working before I install Tomcat...

Thanks for any ideas.

Brian
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have never seen that error before. I suggest that you do as it says and file a bug report at the given URL. Perhaps they can tell you how to fix the problem.

Also, you can't expect to run a program unless you have a compiled .class file. During development, you typically get this file by running javac to compile your .java files. Perhaps you should compile a program on your old machine and copy the .class file to the new one to see if you can run it. Of course, this doesn't do a lot of good since you need to be able to compile programs on your new machine. Sorry that I can't be of much help.

Out of curiosity, did you format the hard drive and reinstall an OS on this new machine or are you using it "as is"?

Layne
 
Brian Emch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the .class for the application I am trying to run, but get the error that I posted.

This is a "hand-me-down" machine that is a bit better than my previous one, so no new OS install.

Thanks, I'll post this to the sun bug report site. I just thought maybe someone might have run across this before.
 
Dave Tuttle
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would do a clean install of windows. Often that's the only way to fix mysterious system errors.
--Dave
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suggest an new OS install as well. If I bought a hand-me-down machine that's the first thing I would do, mostly because I don't want all their applications and data taking up space that I can use for my own apps and data.

Layne
 
Brian Emch
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to wipe the hard drive this weekend and re-install everyting.

I did get it working by copying the jdk directory from a friends machine. The install will not ever work, but a straight copy of the environment worked OK. Strange.

Thanks for the help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic