Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error:(3, 17) java: package org.junit does not exist- intellij

I recently started using IntelliJ to build my android application project. I imported my sherlock library as a module and added the dependency to my project. However when I try to rebuild my project to check any errors I get a lines of 10 errors like this:

Error:(3, 17) java: package org.junit does not exist
Error:(4, 24) java: package org.junit.runner does not exist
Error:(5, 23) java: package org.robolectric does not exist
Error:(7, 38) java: package org.fest.assertions.api does not exist
Error:(7, 1) java: static import only from classes and interfaces
Error:(9, 2) java: cannot find symbol
  symbol: class RunWith
Error:(11, 6) java: cannot find symbol
  symbol:   class Test
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(13, 20) java: cannot find symbol
  symbol:   method cleanActivityName(java.lang.String,java.lang.String)
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(15, 20) java: cannot find symbol
  symbol:   method cleanActivityName(java.lang.String,java.lang.String)
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
Error:(17, 19) java: cannot find symbol
  symbol:   method cleanActivityName(java.lang.String,java.lang.String)
  location: class com.actionbarsherlock.internal.ResourcesCompatTest
like image 382
Elijah Atuhaire Avatar asked Jul 30 '14 08:07

Elijah Atuhaire


People also ask

How do I fix Java package org JUnit does not exist?

The solution to this is to add junit library as dependency to the project. This can be done by adding junit to global library and then hovering over the error(junit word) and right clicking to add junit to class path.


1 Answers

you can check if the plugin is installed if it is. it is just matter of adding it to class path you can do it automatically by selecting the junit word and then press on the inspection left side yellow bulb choose "add junit to classpath"

like image 81
sivi Avatar answered Sep 22 '22 02:09

sivi