蚂蚁和Eclipse [英] Ant and Eclipse

查看:250
本文介绍了蚂蚁和Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我是初学者Java程序员,最近我已经开始在Java中第4版阅读思维,以巩固我的java颇有基础后,我读头先Java.Problem是,这本书有它,我似乎是自己的图书馆,并且不能使它在​​日食工作,即使我做的一切都是它的网站上说guide.I instaled蚂蚁acordinly这个视频指南的 http://www.youtube.com/watch?v=XJmndRfb1TU 和我得到这个错误:

Hi I am a beginner java programmer and recently I've started reading Thinking in Java 4th edition to consolidate my knoledge of java after I read Head first Java.Problem is that this book has it's own library and I can't seem to make it work in eclipse even after I did everything it said on the website guide.I instaled ant acordinly with this video guide http://www.youtube.com/watch?v=XJmndRfb1TU and i'm getting this error:

无法找到tools.jar.Expected找到它在C:\\ Program Files文件\\的Java \\ jre7 \\ LIB \\ tools.jar中
构建文件:C:\\ TIJ4 \\ code \\ build.xml文件

"Unable to locate tools.jar.Expected to find it in C:\Program files\Java\jre7\lib\tools.jar Buildfile:C:\TIJ4\code\build.xml

编译:

构建失败
C:\\ TIJ4 \\ code \\ build.xml文件:59:需要J2SE5

BUILD FAILED C:\TIJ4\code\build.xml:59:J2SE5 required

总时间:0秒

我试过reinstaling JDK女巫建议在论坛上,但它仍然dident工作,所以我真的不知道该怎么办。

I tried reinstaling JDK witch was suggested on a forum but it still dident work so I don't really know what to do.

谁能告诉我怎样才能解决这个问题?此外,更重要的是,不能在此与Eclipse中单独完成,而无需安装蚂蚁(我只用了日食code书写和编译,所以我不是很熟悉吧)吴丹你。

Can anyone tell me how can I solve this problem? Also, more importantly, can't this be done with Eclipse alone without installing Ant(I've only used eclipse for code writing and compiling so I'm not very familiar with it)Thant you.

推荐答案

您正在使用JRE而不是JDK。安装JDK,并指出PATH和JAVA_HOME变量JDK主,而不是JRE主。

You are using a JRE instead of a JDK. Install a JDK and point your PATH and JAVA_HOME variables to the JDK home, not to the JRE home.

我看到蚂蚁使用来自JRE,例如Java主目录 C:\\ Program Files文件\\的Java \\ jre7 \\
但它应该是 C:\\ Program Files文件\\的Java \\ jdk1.7.0 \\ 或类似

I see that Ant is using the Java Home from the JRE, e.g. C:\Program files\Java\jre7\ But it should be C:\Program files\Java\jdk1.7.0\ or similar.

检查您的系统环境变量(如preSS的Windows键和暂停键在一起,然后选择扩展设置>环境变量,检查JAVA_HOME设置为JDK的安装路径,在PATH变量中,所在的文件夹JDK自带的JRE文件夹之前(或删除/从JDK一个完全替代JRE的路径)。

Check your system's environment variables (e.g. press Windows-Key and Pause together, then select Extended Settings > Environment Variables. Check that JAVA_HOME is set to the JDK installation path and that in the PATH variables, the folder of the JDK comes before the folder of the JRE (or remove/replace the JRE path altogether with the one from the JDK).

蚂蚁需要找到JDK在路径。

Ant needs to find the JDK first in the PATH.

这篇关于蚂蚁和Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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