# Package not found for mixed scala and java build

**URL:** <https://discuss.gradle.org/t/package-not-found-for-mixed-scala-and-java-build/4985>\
**Category:** Old Forum Archive\
**Created:** [March 28, 2014, 4:49am UTC](https://discuss.gradle.org/t/package-not-found-for-mixed-scala-and-java-build/4985 "2014-03-28T04:49:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gagan\_B\_Mishra](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/gagan_b_mishra/32/935_2.png) [@Gagan\_B\_Mishra](https://discuss.gradle.org/u/Gagan_B_Mishra)\
**Post date:** [March 28, 2014, 4:49am UTC](https://discuss.gradle.org/t/package-not-found-for-mixed-scala-and-java-build/4985/1 "2014-03-28T04:49:00Z")

</div>

I have a project with mixed Scala and Java code. The project structure is standard as :

src–\> main–\> java src–\> main–\> scala src–\> test --\> java

src–\> test --\> scala

When I do a gradle build, the compilation fails saying : :compileJava error : package does not exist.

Both my java and scala codes are inter dependent and they import packages from the other. Here gradle is not able to find the package that is inside scala, and imported in a java file.

How do I fix this ?

---

<div class="post-metadata">

**Author:** ![Chris\_Marks](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/chris_marks/32/1310_2.png) [@Chris\_Marks](https://discuss.gradle.org/u/Chris_Marks)\
**Post date:** [March 28, 2014, 4:54am UTC](https://discuss.gradle.org/t/package-not-found-for-mixed-scala-and-java-build/4985/2 "2014-03-28T04:54:00Z")

</div>

I had the same problem several months ago. I found the solution and blogged it. It’s at [http://chrismarks.wordpress.com/2013/07/31/compiling-a-mixed-scala-project-with-gradle/](http://chrismarks.wordpress.com/2013/07/31/compiling-a-mixed-scala-project-with-gradle/).

Let me know if this helps.

---

<div class="post-metadata">

**Author:** ![Gagan\_B\_Mishra](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/gagan_b_mishra/32/935_2.png) [@Gagan\_B\_Mishra](https://discuss.gradle.org/u/Gagan_B_Mishra)\
**Post date:** [March 28, 2014, 7:55am UTC](https://discuss.gradle.org/t/package-not-found-for-mixed-scala-and-java-build/4985/3 "2014-03-28T07:55:00Z")

</div>

Great. This solved the problem.

Thanks a lot.
