将hibernate-orm源导入eclipse juno

时间:2013-08-13 13:47:29

标签: eclipse hibernate gradle

我想将hibernate源代码作为java项目导入eclipse。我是这个领域的新人,我被困住了。我按照https://community.jboss.org/wiki/BuildingHibernateORM4x5x中的说明进行操作。安装了git,下载了hibernate-orm。接下来我执行了此操作./gradlew eclipse,但收到了以下错误。

Downloading http://services.gradle.org/distributions/gradle-1.6-bin.zip

Unzipping /home/souvik/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/gradle-1.6-bin.zip to /home/souvik/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok
Exception in thread "main" java.lang.RuntimeException: java.util.zip.ZipException: error in opening zip file
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:78)
    at org.gradle.wrapper.Install.createDist(Install.java:47)
    at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:129)
    at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:132)
    at java.util.zip.ZipFile.<init>(ZipFile.java:169)
    at org.gradle.wrapper.Install.unzip(Install.java:160)
    at org.gradle.wrapper.Install.access$400(Install.java:29)
    at org.gradle.wrapper.Install$1.call(Install.java:70)
    at org.gradle.wrapper.Install$1.call(Install.java:47)
    at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:65)
    ... 3 more

所以我下载了gradle-1.6.bin.zip并将其复制到/home/souvik/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/文件夹并运行相同的命令,这次我收到此错误

    Unzipping /home/souvik/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/gradle-1.6-bin.zip to /home/souvik/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok
    Set executable permissions for: /home/souvik/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/gradle-1.6/bin/gradle

    FAILURE: Build failed with an exception.

    * What went wrong:
    Failed to notify model configuration listener.
    > Could not resolve all dependencies for configuration ':runtime'.
       > Could not resolve org.apache.ant:ant:1.8.2.
         Required by:
             :buildSrc:unspecified
          > Could not GET 'http://repo1.maven.org/maven2/org/apache/ant/ant/1.8.2/ant-1.8.2.pom'.
             > peer not authenticated
          > Could not GET 'http://repository.jboss.org/nexus/content/groups/public/org/apache/ant/ant/1.8.2/ant-1.8.2.pom'.
             > peer not authenticated
       > Could not resolve org.javassist:javassist:3.15.0-GA.
         Required by:
             :buildSrc:unspecified
          > Could not GET 'http://repo1.maven.org/maven2/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.pom'.
             > peer not authenticated
          > Could not GET 'http://repository.jboss.org/nexus/content/groups/public/org/javassist/javassist/3.15.0-GA/javassist-3.15.0-GA.pom'.
             > peer not authenticated

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    BUILD FAILED

    Total time: 16.359 secs

我只是想知道如何将git clone作为java项目导入我的eclipse juno?我曾尝试为eclipse安装m2eclipse插件,但它没有用。

PS:我在ubuntu 12.04,我在代理防火墙内

2 个答案:

答案 0 :(得分:0)

您必须使用代理设置配置Gradle,例如
gradlew eclipse -Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080。有关详细信息,请参阅Accessing the web via a proxy中的Gradle User Guide

答案 1 :(得分:0)

解决了,我跑了

  

JAVA_HOME = / usr / lib中/ JVM / JAVA -7-的openjdk-I386

该错误具有误导性Unsupported major.minor version 51.0这给人的印象是不支持版本51(java 7)。我们应该使用Java 6.

应该是错误,

  

不支持当前的Java版本50,使用Java版本7(51:0及更高版本)`