SBT 看不到 Java 类
我的目录树如下所示:
src/main/ --- java (some .java files)
|
|- scala (subdirectories with .scala files)
|
|- resources (some images)
我尝试将用 Java 编写的包导入到我的 Scala 项目中。
[error] /home/ciembor/test/src/main/scala/TestView.scala:9: not found: object waveform
[error] import waveform._
[error] ^
我认为 sbt 不会浏览 src/main/java 中的文件。我怎样才能强迫它?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 java 文件是否位于正确的目录中,例如 src/main/java/waveform/...?
与 scala 不同,java 文件层次结构应该与其打包相匹配。 Scala/sbt 将使 scala 文件发生这种情况,但不会发生 java 文件。
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.