0

我想将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 并且我在代理防火墙内

4

2 回答 2

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 及更高版本)`

于 2014-08-22T03:55:16.720 回答
0

您必须使用代理设置配置 Gradle,例如
gradlew eclipse -Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080. 有关详细信息,请参阅Gradle 用户指南中的通过代理访问 Web

于 2013-08-13T14:06:44.930 回答