Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » class file has wrong version 50.0, should be 49.0
class file has wrong version 50.0, should be 49.0 [message #263037] Wed, 13 August 2008 01:18 Go to next message
Eclipse UserFriend
Originally posted by: johnstoner2.gmail.com

Eclipse is driving me nuts. If ant worked from the command line on this
box, I'd only use the editor.

However, it doesn't so I'm using ant by way of eclipse. It's painfully
confusing. I'm getting this output:

file: /Users/jstoner/Documents/workspace/jbp/build.xml
compile:
[javac] Compiling 15 source files to
/Users/jstoner/Documents/workspace/jbp/target
[javac]
/Users/jstoner/Documents/workspace/jbp/src/boogiepants/displ ay/Instrument.java:17:
cannot access com.illposed.osc.OSCPortOut
[javac] bad class file:
/Library/Java/Extensions/javaosc.jar(com/illposed/osc/OSCPor tOut.class)
[javac] class file has wrong version 50.0, should be 49.0
[javac] Please remove or make sure it appears in the correct
subdirectory of the classpath.
[javac] import com.illposed.osc.OSCPortOut;
[javac] ^
[javac] 1 error

Now, when I go to the OSC project, and look at Properties > Java Compiler,
I see all the options set to 1.5 (which I think is 49.0, right?) Whether I
choose to enable project specific settings that is what I see and what I
want.

But I still get the error.

When I go to my ant build.xml, I add

<property name="build.compiler" location="javac1.5" />

just to be sure I'm using the right compiler.

But I still get the error.

So, in eclipse, what really, really controls the compiler version? Is it
the build.xml, or is in the project properties, or is it something else?
Re: class file has wrong version 50.0, should be 49.0 [message #263042 is a reply to message #263037] Wed, 13 August 2008 01:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnstoner2.gmail.com

even better:

when I go into Properties > Java Cmpiler for the project I'm failing to
compile on, I get a message: 'The currently displayed page contains
invalid values.'
Re: class file has wrong version 50.0, should be 49.0 [message #263046 is a reply to message #263042] Wed, 13 August 2008 02:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnstoner2.gmail.com

OK, fixed the 'invalid values' thing, still seeing the other problem.
Re: class file has wrong version 50.0, should be 49.0 [message #263052 is a reply to message #263037] Wed, 13 August 2008 05:35 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
John Stoner wrote:
> Eclipse is driving me nuts. If ant worked from the command line on this
> box, I'd only use the editor.
>
> However, it doesn't so I'm using ant by way of eclipse. It's painfully
> confusing. I'm getting this output:
>
> file: /Users/jstoner/Documents/workspace/jbp/build.xml
> compile:
> [javac] Compiling 15 source files to
> /Users/jstoner/Documents/workspace/jbp/target
> [javac]
> /Users/jstoner/Documents/workspace/jbp/src/boogiepants/displ ay/Instrument.java:17:
> cannot access com.illposed.osc.OSCPortOut
> [javac] bad class file:
> /Library/Java/Extensions/javaosc.jar(com/illposed/osc/OSCPor tOut.class)
> [javac] class file has wrong version 50.0, should be 49.0
> [javac] Please remove or make sure it appears in the correct
> subdirectory of the classpath.
> [javac] import com.illposed.osc.OSCPortOut;
> [javac] ^
> [javac] 1 error


So, it looks like you've got a version of javaosc.jar in your JRE
extensions folder, that is incompatible with Java 1.5. It does seem
like that would cause problems. How did it get there?
Re: class file has wrong version 50.0, should be 49.0 [message #263092 is a reply to message #263052] Wed, 13 August 2008 18:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnstoner2.gmail.com

I beg your pardon, that was unclear. Yes, I built that jar using eclipse
and copied it there. The problem is I can't seem to get it to build using
Java 1.5. Whether I monkey with the build.xml file or in project
preferences, it seems to create a 1.6 jar, which fails.
Re: class file has wrong version 50.0, should be 49.0 [message #263104 is a reply to message #263092] Wed, 13 August 2008 21:01 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: wegener.cboenospam.com

"John Stoner" <johnstoner2@gmail.com> wrote in message
news:3ca362ea52a5aa4414210af1374066f2$1@www.eclipse.org...
> I beg your pardon, that was unclear. Yes, I built that jar using eclipse
> and copied it there. The problem is I can't seem to get it to build using
> Java 1.5. Whether I monkey with the build.xml file or in project
> preferences, it seems to create a 1.6 jar, which fails.
>
The fact that the 1.6 version of the jar exists on your build path is
preventing you from building using 1.5. The 1.6 version of class files are
being found while running your build. When the 1.5 compiler encounters a
1.6 version class file, it gives the error. You need to get the 1.6 jar
file off of your classpath in order for a 1.5 build to be successful.
Re: class file has wrong version 50.0, should be 49.0 [message #263115 is a reply to message #263104] Thu, 14 August 2008 00:15 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: johnstoner2.gmail.com

Yes. You're missing the point. When I remove it and rebuild, I get another
1.6 jar. No matter what my build.xml says, no matter how I configure the
project, no matter how man times I choose the 1.5 options, it seems to
want to make a 1.6 jar. Eclipse really seems to think I should build this
project as 1.6.

Asking again: can someone give me the exhaustive list of the ways to
persuade Eclipse the 1.5 is the true way?
Re: class file has wrong version 50.0, should be 49.0 [message #263121 is a reply to message #263115] Thu, 14 August 2008 01:47 Go to previous messageGo to next message
Walter Harley is currently offline Walter HarleyFriend
Messages: 847
Registered: July 2009
Senior Member
John Stoner wrote:
> Yes. You're missing the point. When I remove it and rebuild, I get
> another 1.6 jar. No matter what my build.xml says, no matter how I
> configure the project, no matter how man times I choose the 1.5 options,
> it seems to want to make a 1.6 jar. Eclipse really seems to think I
> should build this project as 1.6.
> Asking again: can someone give me the exhaustive list of the ways to
> persuade Eclipse the 1.5 is the true way?

I'm a little puzzled that you think this is an Eclipse problem, since
you've said you're using Ant and javac, with a customized build.xml.
Not saying it's not, just saying it still seems like there's missing
information here.

Note that the properties you set for the Eclipse compiler don't
necessarily have anything at all to do with what's in your build.xml or
what build.xml tells javac. The Eclipse Java compiler is not javac;
Eclipse has its own compiler.

If you make a project that does not use a build.xml, and build it with
Eclipse, do you get the class versions you'd expect?

Can you figure out why Ant doesn't work outside of Eclipse on your
machine? That seems like a red flag to me.
Re: class file has wrong version 50.0, should be 49.0 [message #263127 is a reply to message #263121] Thu, 14 August 2008 05:05 Go to previous message
Eclipse UserFriend
Originally posted by: johnstoner2.gmail.com

Walter Harley wrote:

> Can you figure out why Ant doesn't work outside of Eclipse on your
> machine? That seems like a red flag to me.

OK, that makes sense. When I found I could invoke ant from within Eclipse,
I dispensed with the command line (I have other things to do than dick
around with ant.)

OK, just double-checked, and the issue with command-line ant is that it
looked for java in $JAVA_HOME/bin, not $JAVA_HOME/Commands, where it lives
on the Mac. Easy fix, but doesn't seem to solve this problem.

I think this is one for the ant forums. Thanks for the attention.
Previous Topic:No source available for "main() "
Next Topic:php support install woes - Ganymeade
Goto Forum:
  


Current Time: Thu Mar 28 10:11:19 GMT 2024

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

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

Back to the top