I installed Ubuntu 12.04(precise)64-bit alongside MacBookPro OS which its processor :Intel® Core™ i5-3210M CPU @ 2.50GHz × 4. Then I am trying for several days to install eucalyptus 3.2.0 by following this guide.
When I reached the build phase, it failed due to this issue :
BUILD FAILED
/home/asma/eucalyptus-3.2.0/clc/build.xml:111: The following error occurred while executing this line:
java.lang.UnsupportedClassVersionError: org/codehaus/groovy/ant/Groovy : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:643)
at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1124)
at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1295)
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1351)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1311)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1064)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
at org.apache.tools.ant.AntTypeDefinition.innerGetTypeClass(AntTypeDefinition.java:194)
at org.apache.tools.ant.AntTypeDefinition.getTypeClass(AntTypeDefinition.java:168)
at org.apache.tools.ant.AntTypeDefinition.icreate(AntTypeDefinition.java:215)
at org.apache.tools.ant.AntTypeDefinition.create(AntTypeDefinition.java:206)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:286)
at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:264)
at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:417)
at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
at org.apache.tools.ant.Task.perform(Task.java:347)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:622)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Total time: 0 seconds
make[1]: *** [build] Error 1
make[1]: Leaving directory `/home/asma/eucalyptus-3.2.0/clc'
make: *** [build] Error 2
Ff course I searched and googled, but all solutions state that make sure that java and javac versions are the same since this issue occurs when with java version of compile and run is conflicting. I have the same version for java and javac which is :
asma@asma-MacBookPro:~$ java -version
java version "1.6.0_31"
OpenJDK Runtime Environment (IcedTea6 1.13.3) (6b31-1.13.3-1ubuntu1~0.12.04.2)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
asma@asma-MacBookPro:~$ javac -version
javac 1.6.0_31
Here is ant version :
asma@asma-MacBookPro:~$ ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
I have only openjdk-6-jdk installed on my Ubuntu right now and I removed java7. Also I tried to have only openjdk-7-jdk but the build still was not successful.
What would be the reason for this error ? Any thoughts or suggestions? May I need to alter build.xml?
During the build process for Eucalyptus, it will perform a submodule checkout of github.com/euaclyptus/eucalyptus-cloud-libs which contains the jars necessary to build from source. When building older versions of Eucalyptus, it doesn't always checkout the correct tag/branch for cloud-libs. If you go into eucalyptus/clc/lib and do a git status
you should be able to see which branch is checked out. If it is #testing, then the build will not work because the dependencies have changed quite a bit since 3.2.0. I believe there is a tag for 3.2.2 that may work correctly. Because of the way that the build process does the checkout on that folder, it may not be as easy as doing git checkout.
Instead, you may have to delete that folder and manually checkout the eucalyptus-cloud-libs repository which is a large-ish download.
Btw - while working on Eucalyptus, we use Java7, so you are better off installing it instead of 6.
If you are building from source, I would suggest trying to build from #testing, rather than an older release. Although Ubuntu is not supported, I have built Eucalyptus and run it on Ubuntu in the past. That guide is as good as any, but be prepared to perform some hackery. I vaguely remember commenting out some unit tests in Makefiles to make the build succeed.