NetBeans的斜面建设时发现的rt.jar [英] NetBeans Cant find rt.jar when building

查看:331
本文介绍了NetBeans的斜面建设时发现的rt.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在NetBeans7.2一个简单的Java项目,当我试图清理/编译失败:

I have a simple Java project in NetBeans7.2, and when I try to Clean/Build it fails:

Building jar: D:\MEUS PROJETOS\_Workspace\JavaWorkspace\Mina\dist\Mina.jar
To run this application from the command line without Ant, try:
java -jar "D:\MEUS PROJETOS\_Workspace\JavaWorkspace\Mina\dist\Mina.jar"
Realizando o ofuscamento do código
Obfuscating dist/Mina.jar...
Created dir: D:\MEUS PROJETOS\_Workspace\JavaWorkspace\Mina\build\obfuscated
ProGuard, version 4.8
Reading program jar [D:\MEUS PROJETOS\_Workspace\JavaWorkspace\Mina\dist\Mina.jar]
Reading library jar [C:\Program Files\Java\jdk1.7.0\jre\lib\ext\jna.jar]
Reading library jar [C:\Program Files\Java\jdk1.7.0\jre\lib\ext\mysql-connector-java-5.1.21-bin.jar]
Reading library jar [C:\Program Files\Java\jre7\lib\rt.jar]
Reading library jar [C:\Library\Java\Home\lib\rt.jar]
D:\MEUS PROJETOS\_Workspace\JavaWorkspace\Mina\build.xml:28: Can't read [C:\Library\Java\Home\lib\rt.jar] (No such file or directory)
BUILD FAILED (total time: 5 seconds)

这是奇怪,因为我的有[C:\\图书馆\\的Java \\首页\\ lib目录\\ rt.jar中]叫我的项目的库(有没有C:\\库在我的电脑的话)!

It's odd because I don't have that [C:\Library\Java\Home\lib\rt.jar] called in my project's library (there is no "C:\Library" in my computer at all)!

此外,为什么rt.jar中被再次调用,如果它已经从所谓的C:\\ Program Files文件\\的Java \\ jre7 \\ lib目录\\ rt.jar的?

Also, why "rt.jar" is called again, if it's already called from "C:\Program Files\Java\jre7\lib\rt.jar"?

我完全不知道在哪里这个从哪里来,也不在那里我可以改变它(因为它是不是在我的项目的库列表)。

I have absolutely no idea where this came from, nor where I can change it (because it is not in my project's library list).

在此先感谢!请原谅我的英语不好...

Thanks in advance! Forgive my bad english...

编辑:
我只是想通了,当应用程序被编译(建)这个问题不会发生,但是当NetBeans的ProGuard4.8插件试图混淆!

EDITED: I just figured out that this issue doesn't happen when the application is compiled (build), but when NetBeans' ProGuard4.8 plugin try to Obfuscate!

推荐答案

我想通过简单的Java项目从NetBeans中的Java类别新建项目...从动作的意思是Java应用程序项目文件菜单。

I suppose that by "simple Java project" you mean the "Java application" project from "Java" category in NetBeans "New Project..." action from "File" menu.

Netbeans的默认构建系统是的蚂蚁。蚂蚁是编译,包和运行从项目源头code程序。

Netbeans default build system is Ant. Ant is the program that compiles, packs and runs the source code from your project.

如果您无法找到字符串C:\\图书馆\\的Java \\首页\\ lib目录\\ rt.jar的随时随地的项目属性窗口,未来的地方去寻找有属性在NB-文件夹内的文件在项目的根或构建{} -impl .xml文件(从项目为文件的观点变化)。

If you can't find the string "C:\Library\Java\Home\lib\rt.jar" anywhere in the project Properties window, the next place to look for are the properties files inside the nb-folder in project root (change from "Projects" to "Files" view) or the build{-impl}.xml files.

当您在项目视图蚁项目图标的右键点击清理并生成操作读取build.xml文件(其中进口集结impl.xml中的文件),找到干净和JAR 目标中,计算所有相关的目标和的 需要成功运行上述目标和finnally性能运行目标的计算顺序。

When you click on the "Clean and Build" action from the right click on the project icon in the "Projects" view ant reads the build.xml file (which imports the build-impl.xml file), finds the clean and jar targets, calculates all the dependent targets and properties needed to successfully run the aforementioned targets and finnally runs the calculated sequence of targets.

但是,如果它是通过在NetBeans做了一个项目新建项目的行动,在build.xml和NB-项目自动生成,并改变从GUI项目属性effectivley改变build-impl.xml中的零件和一些其它文件。如果你还没有编辑的自动生成的文件,就是不找的地方。

But, if it is a project made through the NetBeans "New project" action, the build.xml and nb-project are automatically generated, and changing the project properties from GUI effectivley changes the parts of build-impl.xml and some other files. In case you hadn't edited the automatically generated files, that is not the place to look for.

接下来的事情要考虑,如果它是Netbeans的缓存问题,请参阅这里它的位置,输入该目录,并删除其内容(我不能保证这将有助于虽然)。

The next thing is to consider if it is Netbeans cache issue, see here for it's location, enter that directory and delete its contents (I can't guarantee it will help though).

有趣的是,rt.jar中通常是JRE_HOME / lib目录,其中JRE_HOME是完整路径一些的 JRE 的安装,这样可能导致你有一个JRE_HOME的环境变量设定这个(不存在)的位置。

Interesting thing is that rt.jar is usually in JRE_HOME/lib directory where JRE_HOME is full path to some JRE installation, so that might lead to conslusion that you have an JRE_HOME environment variable set to this (nonexistent) location.

这一切都只是猜测,但是这个东西应该帮助你。请反馈。

It's all just guesses but something of this should help you. Please feedback.

这篇关于NetBeans的斜面建设时发现的rt.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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