0

I am developing an application in IntelliJ which has a class HackTrickBoard in a well defined namespace AbstractGames.ConcreteGames.mnkGame.HackTrick. In the same namespace I have created a new class HackTrickGUI with one method Main, in this method I simply instantiate a new HackTrickBoard class.

package AbstractGames.ConcreteGames.mnkGame.HackTrick; // Marked as unused in IntelliJ import AbstractGames.ConcreteGames.mnkGame.HackTrick.HackTrickBoard; public class HackTrickGUI { public static void main(String s[]) { //HackTrickBoard board = new HackTrickBoard(); AbstractGames.ConcreteGames.mnkGame.HackTrick.HackTrickBoard board = new AbstractGames.ConcreteGames.mnkGame.HackTrick.HackTrickBoard(); } } 

When I try to compile this code I am given an error

java: cannot find symbol symbol: class HackTrickBoard location: AbstractGames.ConcreteGames.mnkGame.HackTrick 

It seems that java cannot find the HackTrickBoard class yet knows where it is? IntelliJ had no issue finding it from the autocomplete menu and does not highlight its syntax as an error.

Is something wrong with Main?

In IntelliJ for the Run/Debug configurations I did not see an option for a command line application so I am starting this as a "Application", maybe this is the issue?

5
  • How does HackTrickBoard class look like? Post its contents and the screenshot of the project view with this file. Commented Feb 16, 2017 at 23:40
  • It is literally an empty class named HackTrickBoard. Commented Feb 16, 2017 at 23:44
  • Does it have the proper package statement, maybe it's excluded from compilation? Commented Feb 16, 2017 at 23:45
  • Yes the package is listed at the top of the file package AbstractGames.ConcreteGames.mnkGame.HackTrick;. Hmm, how can I check if its excluded from compilation. I actually think that might the issue.. Commented Feb 16, 2017 at 23:46
  • The class icon will have a small cross (x) on it, that is why I asked a screenshot of the project view, see this answer. Commented Feb 16, 2017 at 23:48

1 Answer 1

1

The class could be excluded from compilation, it's indicated by a small x on the class icon in the project view.

Excludes can be removed here:

excludes

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.