我安装了Ubuntu 12.04(精确)64位和MacBookPro操作系统,其处理器:英特尔®酷睿™i5-3210M CPU @ 2.50GHz×4。然后我试着连续几天安装eucalyptus 3.2.0 guide
当我到达构建阶段时,由于此问题而失败:
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
当然我搜索并用Google搜索,但所有解决方案都声明确保java和javac版本是相同的,因为当java版本的编译和运行发生冲突时会出现此问题。我有相同的java和javac版本:
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
这是蚂蚁版:
asma@asma-MacBookPro:~$ ant -version
Apache Ant(TM) version 1.8.2 compiled on December 3 2011
我现在只在我的Ubuntu上安装了openjdk-6-jdk,我删除了java7。此外,我试图只有openjdk-7-jdk,但构建仍然没有成功。
出现此错误的原因是什么?有什么想法或建议吗?我可以修改build.xml吗?
答案 0 :(得分:0)
在Eucalyptus的构建过程中,它将执行github.com/euaclyptus/eucalyptus-cloud-libs的子模块检出,其中包含从源构建所需的jar。在构建旧版本的Eucalyptus时,它并不总是检查cloud-libs的正确标记/分支。如果你进入eucalyptus / clc / lib并执行git status
,你应该能够看到哪个分支被检出。如果它是#testing,那么构建将无法工作,因为从3.2.0开始,依赖关系已经发生了很大的变化。我相信3.2.2的标签可以正常工作。由于构建过程对该文件夹进行检出的方式,它可能不像执行git checkout.
那么容易。相反,您可能必须删除该文件夹并手动检出eucalyptus-cloud-libs存储库,这是一个大量下载。
顺便说一下 - 在使用Eucalyptus时,我们使用的是Java7,因此最好安装它而不是6.
如果你是从源代码构建的,我建议尝试使用#testing构建,而不是使用旧版本。虽然不支持Ubuntu,但我已经构建了Eucalyptus并在过去在Ubuntu上运行它。该指南与任何指南一样好,但要准备好执行一些hackery。我依稀记得在Makefile中评论一些单元测试以使构建成功。