简体   繁体   English

Java库安装中的思考

[英]Thinking in java library installation

Hi i've been trying to install the library on Thinking in Java book 4th edition and i hit a very thick brick wall. 嗨,我一直在尝试在《 Thinking in Java》第4版中安装该库,但碰到了很厚的砖墙。 I've done everything that the guide from the website told me to do and i still can't get the library to work. 我已经完成了网站指南要求我做的所有事情,但仍然无法使图书馆正常工作。 From what i've read it seems that the problem is from the build.xml files. 从我阅读的内容来看,问题似乎出在build.xml文件中。 having no xml knowledge I am clueless about how I have to modify it in order for it to work. 没有xml知识,我对如何对其进行修改以使其正常工作一无所知。 In both cmd and eclipse I am getting these error 在cmd和eclipse中我都遇到这些错误

c:\\TIJ4\\code\\build.xml c:\\ TIJ4 \\ code \\ build.xml

Build Failed 建立失败

c:\\TIJ4\\code\\build.xml:59:J2SE5 required c:\\ TIJ4 \\ code \\ build.xml:59:J2SE5必需

Can anyone tell me what I should do ? 谁能告诉我该怎么办?

I am using eclipse if there is a simpler solution by using eclipse rather than ant please help me out. 如果使用eclipse而不是ant有更简单的解决方案,那么我正在使用eclipse,请帮助我。 It's been a week now and I still can't make it work. 现在已经一周了,但我仍然无法正常工作。

The important thing to do is to realize that your ant file has a specific java requirement. 重要的事情是要意识到您的ant文件具有特定的Java要求。

Something to try that might fix this very easily : I believe you can remove any references to a specific JDK, and if you have a reasonably up to date JDK, the build will succeed. 可以尝试解决的问题很容易解决:我相信您可以删除对特定JDK的任何引用,并且如果您拥有相当最新的JDK,则构建将成功。

The definete fix : Look into the exact (line 59) of your build file, and try to satisfy the java version that line requires. 定义修复:查找构建文件的确切内容(第59行),并尝试满足该行所需的Java版本。 Java is generally backwords compatible -- something designed to run in J2SE5 should run in the latest JDK. Java通常与Backword兼容-设计为在J2SE5中运行的某些东西应在最新的JDK中运行。 Its not terribly difficult to update your JDK (just google for instructions on your OS). 更新您的JDK并非十分困难(只需在Google上获取有关操作系统的说明即可)。

  • The most common mistake I see is that people who have the java run time installed believe they also have the Java SDK as well. 我看到的最常见错误是,安装了Java运行时的人认为他们也同样拥有Java SDK。

Does this "install the library" means you want to look at the code and run them in your eclipse? 这个“安装库”是否意味着您要查看代码并在Eclipse中运行它们? If so I can share my experience with you. 如果是这样,我可以与您分享我的经验。

  1. First run the Eclipse.py script; 首先运行Eclipse.py脚本; this will add package info to the source code 这会将软件包信息添加到源代码中
  2. Create a new Java project in Eclipse, and then just copy all the source code folders to the src source folder in eclipse, these folders will then be recognized as Java packages. 在Eclipse中创建一个新的Java项目,然后将所有源代码文件夹复制到eclipse中的src源文件夹,这些文件夹将被识别为Java包。
  3. You should be able to run the classes with a main function. 您应该可以使用main函数运行这些类。

You can also configure which java version to use for this project in Eclipse build path. 您还可以在Eclipse构建路径中配置用于该项目的Java版本。 1.5 or higher will work. 1.5或更高将起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM