Getting unsupported major.minor errors when trying to run TestNG in Ant

140 views
Skip to first unread message

Greg

unread,
May 13, 2012, 1:37:43 AM5/13/12
to testng...@googlegroups.com
Hey,

I've been trying to run my tests headlessly in anticipation of running them off of a remote Unix box in the future. So I've gotten a decent start to Ant, but when trying to run my first tests I've been running into some errors:

java.lang.UnsupportedClassVersionErrors: <my testclass> : Unsupported major.minor version 8243.8224

I've been running over this for about 2 hours no and no closer to a solution. I thought it might be something to do with not being able to import my .jar files but I think I ruled that out, although don't take my word on it. Right now my thoughts are it is some kind of error in the compiled class. See I compiled my class in Eclipse and then copied it to an external directory to emulate what is actually going to happen when I start running off the Unix box. Dunno if this is the cause though. Any help is appreciated!

Greg

Cédric Beust ♔

unread,
May 13, 2012, 3:59:29 AM5/13/12
to testng...@googlegroups.com
Hi Greg,

This usually happens when you try to run a class compiled with javac version N with a java version <N. However, the numbers you are giving are surprising (they should be around 49).

I suspect your .class files have become corrupt somehow.

-- 
Cédric






Greg

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/NcqKw-jrJhEJ.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

Greg

unread,
May 13, 2012, 2:21:57 PM5/13/12
to testng...@googlegroups.com
Yeah right, I'm pretty sure that might have been what was screwing me up:
A. I had exported my tests from Eclipse, but I never actually modeled my Eclipse file structure in my ant project, even though I had compiled in Eclipse, so I was messing around with the compiled file to try to get my class file to run in my new file structure
B. I had compiled with JRE7 in Eclipse. I changed my JRE system library to JDK1.7 and then compiled using that.

When I compiled using the JDK and changed my project directory to look like my Eclipse workspace, and didn't change the compiled file, everything worked. 

Greg

unread,
May 13, 2012, 2:23:52 PM5/13/12
to testng...@googlegroups.com
Oh wow crap didn't mean to repost my original msg two times...
Reply all
Reply to author
Forward
0 new messages