Java - Bad version number in .class file - error; Where is java.io and java.util? [message #265234] |
Sun, 05 October 2008 14:40  |
Eclipse User |
|
|
|
Originally posted by: siegfried.heintze.com
I had some SWT programs that were working until (I think) a groovy
installation wiped out my classpath and I had to reenter it from memory
(that was several months ago and it is quite possible I have not fired up
eclipse since then).
So I was getting this error:
Java - Bad version number in .class file - error
http://forums.sun.com/thread.jspa?messageID=10029598
Hmm... OK, I'm not using java 5 any more so I used "Add Remove Programs
(ARP)" and uninstalled java 1.5 and its updates and rebooted.
I downloaded eclipse 3.5M2 and that did not help.
So now, according to Eclipse, all the imports on my program cannot be found
such as java.io and java.util.
JAVA_HOME has the value of C:\Program Fiels\Java\jdk1.6.0
dir "%JAVA_HOME%" lists the contents of this directory and it seems to be
correct.
I can compile "helloworld.java" and it works from the command line.
So what is wrong with Eclipse?
Thanks,
Siegfried
|
|
|
|
Re: Java - Bad version number in .class file - error; Where is java.io and java.util? [message #265241 is a reply to message #265236] |
Mon, 06 October 2008 07:12  |
Eclipse User |
|
|
|
Siegfried,
It's generally easier, in my opinion, to develop plugins, even if you
will use the resulting jars stand-alone not as plugins. That way you
don't need to manage your classpath in such painful detail but rather
can rely on the Dependencies tab of the MANIFEST.MF editor to set up
your dependencies to other plugins at build time and for launching.
Failing that, you need to track down each jar for each class the
compiler is complaining about needed and add that jar to the build path...
Siegfried Heintze wrote:
> Hmmm... OK, I think I figured it out. For the project I saw that it was
> using the 1.6 compiler but the jar dependendencies for the java build path
> included the 1.5 JRE! Now how did that happen? I was running 1.6 before and
> debugging code that was probably incompatible with java 1.6. So I deleted
> the JRE 1.5 and added the JRE 1.6 and my code works again. Whew! Another
> close call!
>
> I still have two error though:
> I have some sample jface code from the one of the SWT books and the error
> message complains that "org.eclipse.commands.common.EventManager cannot be
> resolved -- it is indirectly referenced by a required .class". So I went to
> add an external jar and found org.eclipse.commands.common and that only
> fixed one error. I have one still complaining the reference cannot be
> resolved. So what else do I need to put in my build path?
>
> Thanks!
> Siegfried
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.30712 seconds