Thanks for the suggestions, guys. The build succeeded by doing either:

ant compile
sudo python src/python/setup.py install

or:

sudo env JAVA_HOME=$JAVA_HOME ant install

as JAVA_HOME is set (to 1.6) under my account but not set under sudo. I
don't know why JAVA_HOME is required, when default Java is 1.6 (sudo
javac -version returns 1.6).

ant is 1.7.1.

Steven


-----Original Message-----
From: Patrick Hunt [mailto:ph...@apache.org] 
Sent: Monday, October 12, 2009 9:33 PM
To: zookeeper-user@hadoop.apache.org
Subject: Re: UnsupportedClassVersionError when building zkpython

I've seen this before. Either you have an old version of ant, or your 
JAVA_HOME is not set, or it's set incorrectly (to 1.5 and ant is built 
for 1.6, or vice versa).

Patrick

Henry Robinson wrote:
> Hi Steven -
> 
> I also see that problem if I build on my Mac sometimes. I'm looking
into a
> proper fix, but for now you can do:
> 
> ant compile
> sudo python src/python/setup.py install
> 
> to build and install manually. If you have a moment, can you let me
know
> which ant you are using? (ant -version)
> 
> Thanks for bringing this up!
> 
> Henry
> 
> On Mon, Oct 12, 2009 at 9:06 PM, Steven Wong <sw...@netflix.com>
wrote:
> 
>> Any idea how I can get it to build? ZooKeeper 3.2.1 (tarball release)
on
>> Mac OS X 10.5.8. Thanks.
>>
>>
>>
>> sw...@lgmac-swong:~/lib/zookeeper/src/contrib/zkpython 9173> sudo ant
>> install
>>
>> Buildfile: build.xml
>>
>>
>>
>> BUILD FAILED
>>
>> java.lang.UnsupportedClassVersionError: Bad version number in .class
>> file
>>
>>                at java.lang.ClassLoader.defineClass1(Native Method)
>>
>>                at
>> java.lang.ClassLoader.defineClass(ClassLoader.java:675)
>>
>>                at
>>
org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.j
>> ava:1146)
>>
>>                at
>>
org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.ja
>> va:1324)
>>
>>                at
>>
org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader
>> .java:1388)
>>
>>                at
>>
org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1341)
>>
>>                at
>>
org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1088)
>>
>>                at
java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>
>>                at
>>
org.apache.tools.ant.taskdefs.Available.checkClass(Available.java:446)
>>
>>                at
>> org.apache.tools.ant.taskdefs.Available.eval(Available.java:273)
>>
>>                at
>> org.apache.tools.ant.taskdefs.Available.execute(Available.java:225)
>>
>>                at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>
>>                at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown
>> Source)
>>
>>                at
>>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>> Impl.java:25)
>>
>>                at java.lang.reflect.Method.invoke(Method.java:585)
>>
>>                at
>>
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
>> 06)
>>
>>                at org.apache.tools.ant.Task.perform(Task.java:348)
>>
>>                at
org.apache.tools.ant.Target.execute(Target.java:357)
>>
>>                at
>>
org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142
>> )
>>
>>                at
>>
org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:9
>> 3)
>>
>>                at org.apache.tools.ant.Main.runBuild(Main.java:743)
>>
>>                at org.apache.tools.ant.Main.startAnt(Main.java:217)
>>
>>                at
>> org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
>>
>>                at
>> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>>
>>
>>
>> Total time: 0 seconds
>>
>> sw...@lgmac-swong:~/lib/zookeeper/src/contrib/zkpython 9178> sudo
javac
>> -version
>>
>> javac 1.6.0_07
>>
>>
>>
>>
> 

Reply via email to