Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem Compiling  RSS feed

 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble compiling several classes that have a package name. They are in the correect directory and the first Interface class compiles but the other two will not. The second class gives the following error message: 'MovieQuestion.java:4:cannot resolve symbol
symbol: class MovieInterface
location: class iVideos.MovieQuestion
public class MovieQuestion implements MovieInterface {

1 error

Could someone help me interpret this error message? Thanks.
 
Sanjaya Sugiarto
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the directory where the needed classes (in this case MovieInterface included in classpath?
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, all classes in classpath.
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, all classes in classpath.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does the MovieInterface interface have the package statement in it?
 
Dan Grindstaff
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, MovieInterface has package statement.
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is in your CLASSPATH?
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16026
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If MovieInterface is in a package, for example a package named "org.mypackage", then its sourcefile must be in a subdirectory org\mypackage, and you must add the directory that contains the "org" directory to the classpath.

For example, suppose you have a directory C:\Java\Project\org\mypackage that contains MovieInterface.java, you must add the directory C:\Java\Project to the classpath.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!