简体   繁体   English

为eclipse安装JUnit? (新手)

[英]Installing JUnit for eclipse? (Newbie)

As a newbie to programming, I am finding it really quite difficult to install all the necessary software and such to get everything running. 作为编程的新手,我发现安装所有必要的软件非常困难,以便让一切运行起来。

Up until now I have been using the command prompt and javac along with gedit to edit/compile my code, but we are meant to be using eclipse and then JUnit to test it. 到目前为止,我一直在使用命令提示符和javac以及gedit来编辑/编译我的代码,但是我们应该使用eclipse然后使用JUnit来测试它。

I have just managed to get eclipse working, but still stuck as to how to get JUnit working. 我刚刚设法让eclipse工作,但仍然坚持如何使JUnit工作。

I am stuck on the installation part... 我被困在安装部分......

The JUnit FAQ ( http://junit.sourceforge.net/doc/faq/faq.htm#started_1 ) states... JUnit FAQ( http://junit.sourceforge.net/doc/faq/faq.htm#started_1 )声明......

Windows

To install JUnit on Windows, follow these steps:

Unzip the junit.zip distribution file to a directory referred to as %JUNIT_HOME%.
Add JUnit to the classpath:

set CLASSPATH=%CLASSPATH%;%JUNIT_HOME%\junit.jar

How can you "unzip" the "junit.zip distribution file" to the directory "%JUNIT_HOME%" and how do you add something to the classpath? 如何将“junit.zip分发文件”“解压缩”到目录“%JUNIT_HOME%”,如何在类路径中添加内容? Where is this class path? 这个班级路径在哪里? I tried extracting the zip folder and typing "%JUNIT_HOME%" into the directory, but it says the destination path is invalid, so I assume this is not what the instructions mean. 我尝试解压缩zip文件夹并在目录中键入“%JUNIT_HOME%”,但它说目标路径无效,所以我认为这不是指令的含义。

Apologies for the noob-questions... I'm finding this technical jargon difficult to find my way around. 为noob-questions道歉...我发现这种技术术语很难找到我的方法。

Any hints for the next steps for installing JUnit will also be appreciated, as I will likely get stuck on those too. 任何有关安装JUnit的后续步骤的提示也将受到赞赏,因为我也可能会遇到这些问题。

If you are using Eclipse, please import the junit.jar file to your classpath in your project. 如果您使用的是Eclipse,请将junit.jar文件导入项目中的类路径。 You can do it by right+click on the project and choose Properties -> Java Build Path. 您可以通过右键单击项目并选择“属性” - >“Java构建路径”来执行此操作。 and add you jar file. 并添加你的jar文件。

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

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