Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » bad class file - wrong version 48.0, should be 47.0
bad class file - wrong version 48.0, should be 47.0 [message #138625] Mon, 02 February 2004 19:46 Go to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

hi, trying to get ant (and junit) to work in eclipse 3.0. the ant build file
runs fine when run from the command line in windoze. the java code compiles
and and runs in eclipse. the test case runs in eclipse as an app and as a
test case.

java home env var is set to a 1.3 jdk. eclipse is started pointing to this
1.3 jdk. ant runtime classpath has tools.jar and rt.jar from the 1.3 jdk.
looks like ant is still using a 1.4.2 rt.jar

ant output is below.

anybody got a clue?

thanks

compile:
[javac] Compiling 2 source files
[javac] [parsing started C:\Program
Files\Development\eclipse3.0\workspace\antcompile\Main.java]
[javac] [parsing completed 63ms]
[javac] [parsing started C:\Program
Files\Development\eclipse3.0\workspace\antcompile\MainTestCa se.java]
[javac] [parsing completed 0ms]
[javac] [loading
C:\Progra~1\Java\j2re1.4.2_03\lib\rt.jar(java/lang/Object.cl ass)]
[javac] C:\Program
Files\Development\eclipse3.0\workspace\antcompile\Main.java: 3: cannot access
java.lang.Object
[javac] bad class file:
C:\Progra~1\Java\j2re1.4.2_03\lib\rt.jar(java/lang/Object.cl ass)
[javac] class file has wrong version 48.0, should be 47.0
[javac] Please remove or make sure it appears in the correct
subdirectory of the classpath.
[javac] public static void main(String[] args) {
[javac] ^
[javac] [total 328ms]
[javac] 1 error

Total time: 860 milliseconds
Re: bad class file - wrong version 48.0, should be 47.0 [message #138653 is a reply to message #138625] Mon, 02 February 2004 20:17 Go to previous messageGo to next message
Eclipse UserFriend
It sounds like you have down everything correctly. You did ensure that the
Ant runtime classpath for the particular Ant build that is failing is
correct (as opposed to just checking the global ant prefs which may have
been overridden)?

Darins

"Ray Tayek" <rtayek.no@spam.freightgate.com> wrote in message
news:bvmqhp$6gn$1@eclipse.org...
> hi, trying to get ant (and junit) to work in eclipse 3.0. the ant build
file
> runs fine when run from the command line in windoze. the java code
compiles
> and and runs in eclipse. the test case runs in eclipse as an app and as a
> test case.
>
> java home env var is set to a 1.3 jdk. eclipse is started pointing to this
> 1.3 jdk. ant runtime classpath has tools.jar and rt.jar from the 1.3 jdk.
> looks like ant is still using a 1.4.2 rt.jar
>
> ant output is below.
>
> anybody got a clue?
>
> thanks
>
> compile:
> [javac] Compiling 2 source files
> [javac] [parsing started C:\Program
> Files\Development\eclipse3.0\workspace\antcompile\Main.java]
> [javac] [parsing completed 63ms]
> [javac] [parsing started C:\Program
> Files\Development\eclipse3.0\workspace\antcompile\MainTestCa se.java]
> [javac] [parsing completed 0ms]
> [javac] [loading
> C:\Progra~1\Java\j2re1.4.2_03\lib\rt.jar(java/lang/Object.cl ass)]
> [javac] C:\Program
> Files\Development\eclipse3.0\workspace\antcompile\Main.java: 3: cannot
access
> java.lang.Object
> [javac] bad class file:
> C:\Progra~1\Java\j2re1.4.2_03\lib\rt.jar(java/lang/Object.cl ass)
> [javac] class file has wrong version 48.0, should be 47.0
> [javac] Please remove or make sure it appears in the correct
> subdirectory of the classpath.
> [javac] public static void main(String[] args) {
> [javac] ^
> [javac] [total 328ms]
> [javac] 1 error
>
> Total time: 860 milliseconds
>
>
Re: bad class file - wrong version 48.0, should be 47.0 [message #138702 is a reply to message #138625] Tue, 03 February 2004 11:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

You can not use 1.4 class-files with 1.3- compiler(s).

Sam Mesh - http://openrules.com
Life is very short, and there's no time,
For coding and testing, my friend.
Re: bad class file - wrong version 48.0, should be 47.0 [message #138783 is a reply to message #138653] Tue, 03 February 2004 17:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Darin Swanson" <Darin_Swanson@us.ibm.com> wrote in message
news:bvmsnr$8le$1@eclipse.org...
> It sounds like you have down everything correctly. You did ensure that the
> Ant runtime classpath for the particular Ant build that is failing is
> correct (as opposed to just checking the global ant prefs which may have
> been overridden)?
>

not sure how i would do this. I have a <property name="java.home"
value="C:/jdk1.3.1_09"/> in the build file. don't know to turn on verbose
and debug from eclipse. ant home and classpath are not set in the
environment, just java home. googleing for: '"bad class file" 47.0 48.0' for
a few days now gets a small number of hits only during the last 6 months or
so (on both web and news). So it seems to be some kind of 1.4 vs 1.3
problem. Adding eclise to the search gets 3 hits on the web on news, all
fairly recent, so maybe it's some kinda bug? (sorry about the other post
darin, but i have to use outook at work and i am not used to it).

thanks

> "Ray Tayek" <rtayek.no@spam.freightgate.com> wrote in message
> news:bvmqhp$6gn$1@eclipse.org...
> > hi, trying to get ant (and junit) to work in eclipse 3.0. the ant build
file
> > runs fine when run from the command line in windoze. the java code
> > compiles and and runs in eclipse. the test case runs in eclipse as an
app and as a
> > test case.
> >
> > java home env var is set to a 1.3 jdk. eclipse is started pointing to
this
> > 1.3 jdk. ant runtime classpath has tools.jar and rt.jar from the 1.3
jdk.
> > looks like ant is still using a 1.4.2 rt.jar
> >
....
> > compile:
> > [javac] Compiling 2 source files
> > [javac] [parsing started C:\Program
> > Files\Development\eclipse3.0\workspace\antcompile\Main.java]
> > [javac] [parsing completed 63ms]
> > [javac] [parsing started C:\Program
> > Files\Development\eclipse3.0\workspace\antcompile\MainTestCa se.java]
> > [javac] [parsing completed 0ms]
> > [javac] [loading
> > C:\Progra~1\Java\j2re1.4.2_03\lib\rt.jar(java/lang/Object.cl ass)]
> > [javac] C:\Program
> > Files\Development\eclipse3.0\workspace\antcompile\Main.java: 3: cannot
....
Re: bad class file - wrong version 48.0, should be 47.0 [message #138795 is a reply to message #138702] Tue, 03 February 2004 17:21 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Sam Mesh" <smesh@openrules.com> wrote in message
news:bvoguu$19l$1@eclipse.org...
> You can not use 1.4 class-files with 1.3- compiler(s).
>

Ok, how do I sto the 1.4 stuff from being used?



thanks
Re: bad class file - wrong version 48.0, should be 47.0 [message #138885 is a reply to message #138795] Tue, 03 February 2004 18:33 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

> Ok, how do I sto the 1.4 stuff from being used?
^^^
Pardon me?..

Sam Mesh - http://openrules.com
Life is very short, and there's no time,
For coding and testing, my friend.
Re: bad class file - wrong version 48.0, should be 47.0 [message #138929 is a reply to message #138885] Wed, 04 February 2004 03:03 Go to previous messageGo to next message
Eclipse UserFriend
Sam Mesh wrote:
> > Ok, how do I sto the 1.4 stuff from being used?
> ^^^
stop
> Pardon me?..
>
> Sam Mesh - http://openrules.com
> Life is very short, and there's no time,
> For coding and testing, my friend.
Re: bad class file - wrong version 48.0, should be 47.0 [message #139052 is a reply to message #138795] Wed, 04 February 2004 08:36 Go to previous messageGo to next message
Eclipse UserFriend
Under Window->Preferences->Java->Compiler choose the "Compliance and
Classfiles" tag and check the compliance settings.

-- Scott

In article <bvp6ej$sqt$1@eclipse.org>, rtayek.no@spam.freightgate.com
says...
>
> "Sam Mesh" <smesh@openrules.com> wrote in message
> news:bvoguu$19l$1@eclipse.org...
> > You can not use 1.4 class-files with 1.3- compiler(s).
> >
>
> Ok, how do I sto the 1.4 stuff from being used?
>
>
>
> thanks
>
>
>
Re: bad class file - wrong version 48.0, should be 47.0 [message #141210 is a reply to message #139052] Wed, 11 February 2004 17:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Scott Stanchfield" <scott@javadude.com> wrote in message
news:MPG.1a8abf8462c77ef098969b@news.eclipse.org...
> Under Window->Preferences->Java->Compiler choose the "Compliance and
> Classfiles" tag and check the compliance settings.
>
> -- Scott
>
i checked this. it is set to 1.3.

but running ant from ecplispe still complains abou bad class files.
(JAVA_HOME is defined in the environement, before eclipse is started, but
ANT_HOME is not).

thanks

> In article <bvp6ej$sqt$1@eclipse.org>, rtayek.no@spam.freightgate.com
> says...
> >
> > "Sam Mesh" <smesh@openrules.com> wrote in message
> > news:bvoguu$19l$1@eclipse.org...
> > > You can not use 1.4 class-files with 1.3- compiler(s).
> > >
> >
> > Ok, how do I sto the 1.4 stuff from being used? ...
...
Re: bad class file - wrong version 48.0, should be 47.0 [message #141221 is a reply to message #141210] Wed, 11 February 2004 17:51 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: smesh.openrules.com

Check Window/Preferences/Ant/Runtime and launcher-properties for your
ant-files.

Sam Mesh - http://openrules.com
Life is very short, and there's no time,
For coding and testing, my friend.
Re: bad class file - wrong version 48.0, should be 47.0 [message #141584 is a reply to message #141221] Thu, 12 February 2004 17:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Sam Mesh" <smesh@openrules.com> wrote in message
news:c0ebfq$q6o$1@eclipse.org...
> Check Window/Preferences/Ant/Runtime and launcher-properties for your
> ant-files. ...

ant/runtime has: ant.jat and optional.jar from eclipse
3.0/plugins/org.apache.ant_a.1.5.4 and a jdk1.3.1_09/lib/tools.jar and
/jre/lib/rt.jst

under jre on the lauch thing (assuming that's run ant from the popup menu).
he has use same jre as eclipse. if i change it to the 1.3, i get
"terminated" on the console output. otherwise i get the same stuff below.

the 1.4 stuff in c:\java is *not* on the windoze path, JAVA_HOME points to
1.3 and classpath is not defined.

and he still says:
compileSrc:

[javac] Compiling 2 source files to C:\Program
Files\Development\eclipse3.0\workspace\locallocale\build\src obj

[javac] C:\Program
Files\Development\eclipse3.0\workspace\locallocale\1\src\l\L .java:3: cannot
access java.lang.Object

[javac] bad class file:
C:\Progra~1\Java\j2re1.4.2_03\lib\rt.jar(java/lang/Object.cl ass)

[javac] class file has wrong version 48.0, should be 47.0 ...

iirc, eclipse needs 1.4. how do you guys use ant and 1.3? i am thinking in
therms of environment variables like classpthath JAVA_HOME, ANT_HOME ... .
do you invoke eclipse with the -vm switches or what?

thanks
Re: bad class file - wrong version 48.0, should be 47.0 [message #141612 is a reply to message #141584] Thu, 12 February 2004 18:39 Go to previous message
Eclipse UserFriend
Originally posted by: rtayek.no.spam.freightgate.com

"Ray Tayek" <rtayek.no@spam.freightgate.com> wrote in message
news:c0gtjv$pt4$1@eclipse.org...
>
> "Sam Mesh" <smesh@openrules.com> wrote in message
> news:c0ebfq$q6o$1@eclipse.org...
> > Check Window/Preferences/Ant/Runtime and launcher-properties for your
> > ant-files. ...
>
> ant/runtime has: ant.jat and optional.jar from eclipse
> 3.0/plugins/org.apache.ant_a.1.5.4 and a jdk1.3.1_09/lib/tools.jar and
> /jre/lib/rt.jst
>
> under jre on the lauch thing (assuming that's run ant from the popup
menu).
> he has use same jre as eclipse. if i change it to the 1.3, i get
> "terminated" on the console output. otherwise i get the same stuff below.
>

discovered that if you go back to the classpath tab and hit update, things
start to work. getting a good compile now on src/ but can't find
junit.import on tst/, but that may be easy to fix as it is probably the old
junit and optional jars that need to be loaded by the same class loader or
something silly.

thanks for your assistance!
Previous Topic:Invalid External Tool Builder in JDT
Next Topic:Add JavaDoc tag and contribute to index
Goto Forum:
  


Current Time: Thu Jul 10 08:53:22 EDT 2025

Powered by FUDForum. Page generated in 0.09733 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top