Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SBT doesn't see Java classes

This is how my directories tree looks like:

src/main/ --- java (some .java files)
          |
          |- scala (subdirectories with .scala files)
          |
          |- resources (some images)

I try to import a package which is written in Java into my Scala project.

[error] /home/ciembor/test/src/main/scala/TestView.scala:9: not found: object waveform
[error] import waveform._
[error]        ^

I think sbt doesn't browse through files from src/main/java. How may I force it?

like image 685
ciembor Avatar asked Dec 05 '25 01:12

ciembor


1 Answers

Are your java files in the proper directories, e.g., src/main/java/waveform/...?

Unlike scala, java file hierarchies are supposed to match their packaging. Scala/sbt will make this happen for scala files but not for java files.

like image 76
smparkes Avatar answered Dec 07 '25 16:12

smparkes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!