日食和放大器; JAR地狱 [英] Eclipse & JAR Hell

查看:249
本文介绍了日食和放大器; JAR地狱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑:我AP preciate常春藤或Maven的建议,但是这仅仅是不是在这个时候,我的选择。我没有使用这些工具的权限。我只是在寻找一种方式让我引用的.classpath JAR文件到我的项目中的文件夹。

I appreciate the suggestions for Ivy or Maven, but this is just not an option for me at this time. I do not have the authority to use those tools. I am simply looking for a way to get my referenced .classpath JARs into a folder inside my project.

我已经创建了一个使用我从其他项目中引用相同的工作空间内约50外部JAR文件的项目。

I have created a project that uses about 50 external JAR files that I referenced from other projects inside the same workspace.

因此​​,我的项目的目录strucure如下:

Thus, my project's directory strucure looks like:

MyProject
    src/
    test/
    Referenced Libraries/
        ... 50+ JARs
    lib/

我的项目编译和运行优美Eclipse内部。但现在我需要添加一个buildscript让其他开发人员可以从SVN上拿下来的项目并运行它独立。要做到这一点,我想将所有当前在Eclipse的内部目录引用的库,并将其复制到我的项目的 lib目录中的JAR 目录中,我将JAR-了最后分配。

My project compiles and runs beautifully inside Eclipse. But now I need to add a buildscript so other developers can pull the project down from SVN and run it standalone. To do that, I'd like to place all the JARs that are currently in Eclipse's in-house directory Referenced Libraries and copy them into my project's lib directory which I will JAR-up with the final distribution.

我在Package Explorer中,并试图把刚才复制粘贴+文件从引用的库的lib / 并没有骰子。我得到以下的Eclipse错误:

I'm in Package Explorer, and have tried to just copy + paste the files from Referenced Libraries to lib/ and no dice. I get the following Eclipse error:

Cannot paste the clipboard contents into the selected elements.

任何人有任何想法我怎么能强制此复制操作的工作?如果我用鼠标右键单击引用的库中的任何JAR我看到一个名为迁移JAR文件 Eclipse的选择,但我怕那会的削减的从当前位置到新的的lib / 目录-n粘贴的JAR文件。因为有确切需要这些JAR文件他们在哪里许多其他项目这是不可行的。

Anybody have any idea how I can force this copy operation to work? If I right-click any JAR inside Referenced Libraries I see an Eclipse option called Migrate JAR file, but I'm afraid that would cut-n-paste the JARs from their current location to the new lib/ directory. This isn't feasible because there are many other projects that need these JAR files exactly where they are.

感谢这里的任何见解!

推荐答案

我不另寻出路,但对自己的JAR文件复制到lib文件夹,引用添加到您的LIB文件(不是外部罐子上你的机器),并把它上传到SVN。

I don't find another way to go but to copy yourself the jars into your lib folder, add the references to your lib files (not to external jars on your machine) and upload it to SVN.

编辑澄清:


  1. 从构建路径中删除所有的引用。现在你不能编译该项目。

  2. 复制你需要将项目的lib文件夹中的每个jar文件。

  3. 再去构建路径和引用添加到您的罐子(LIB上的那些)一个接一个。使用上面写着按钮添加JAR文件...,而不是一个写着外部JAR。

  4. 编译,如果一切都很好,

  5. 上传整个项目SVN。

这篇关于日食和放大器; JAR地狱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆