[ junit ] command line compilation on windows

Compile

javac -cp .;C:\Users\dsin\.m2\repository
\junit\junit\4.12\junit-4.12.jar WhateverWillBe.java ContainerJunit.java

NOTE : To keep it simple, remove package declaraction and import in WhateverWillBe and WhatEverWillBeJunit.

Run

java -cp .;C:\Users\dsin\.m2\repository\junit\junit\4.12\junit-4.12.jar;C:\Users\dsin\.m2\repository\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar org.junit.runner.JUnitCore ContainerJunit

NOTE : Need hamcrest jar file, since it is not bundle in the junit.jar.

http://stackoverflow.com/questions/16845937/compiling-junit-on-windows-8-command-line-error

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s