When I create a Scala SBT project in IntelliJ, everything works fine. I set up the jar dependencies and I can run the examples.
But if I create a Java project and try to run:
Error:(29, 28) java: C:\workspace-java\SparkExamples\src\org\apache\spark\examples\sql\JavaSparkSQL.java:29: package org.apache.spark.sql does not exist
I added that jar to module dependencies which contains the class in the error message. In the IDE everything seems fine, I can navigate into the JavaSparkSQL class. But when I make, it's doesn't find that class.
I added the jar to CLASSPATH, and also copy to JAVA_HOME/jdk/jre/lib/ext.
What do you think what do I wrong? What should I check?
UPDATE: The problem is only with org.apache.spark.sql package. There are other packages what I can use. (org.apache.spark.SparkConf; org.apache.spark.api.java.JavaRDD; etc.)
UPDATE 2.: I gave a try to Eclipse Mars, and it was completed successfully the first time. So it is an IntelliJ specific problem.
UPDATE 3.:
Something wrong with the jar file which comes with Apache Spark (spark-assembly-1.4.1-hadoop2.6.0.jar).
Eclipse has no problem with this jar.
I found that when I delete an irrelevant file from jar ("about.html") then the problem is gone. IntelliJ see every package from the modified jar.
How is this possible?