1

http://www.tutorialspoint.com/junit/junit_environment_setup.htm

I have done everything like in this step by step tutorial and still when I try to write the line

import org.junit.*; 

The "junit" part is lighten red and the error message is "cannot resolve symbol "junit"".

2 Answers 2

1

The tutorial you are following seems to be written for command line usage. (Download jar, set classpath etc). So the same wouldn't work in IntelliJ. IDEs actually make these a lot easier.

To solve your current dilemma, try this. Place the cursor on the red 'junit' (which is basically a broken import) and choose "Add Junit4 to classpath". This will add the necessary junit jars that IDEA ships with to your classpath.

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

1

Open up your build.gradle and make sure JUnit is there

dependencies { testCompile 'junit:junit:4.12' // other dependencies... } 

And for a better link for Android-specifics, read Getting Started with Testing from the Android docs.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.