简体   繁体   中英

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.

I have just managed to get eclipse working, but still stuck as to how to get JUnit working.

I am stuck on the installation part...

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

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? 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.

Apologies for the noob-questions... I'm finding this technical jargon difficult to find my way around.

Any hints for the next steps for installing JUnit will also be appreciated, as I will likely get stuck on those too.

If you are using Eclipse, please import the junit.jar file to your classpath in your project. You can do it by right+click on the project and choose Properties -> Java Build Path. and add you jar file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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