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?

KDecker
  • 6,928
  • 8
  • 40
  • 81
  • How does `HackTrickBoard` class look like? Post its contents and the screenshot of the project view with this file. – CrazyCoder Feb 16 '17 at 23:40
  • It is literally an empty class named `HackTrickBoard`. – KDecker Feb 16 '17 at 23:44
  • Does it have the proper package statement, maybe it's excluded from compilation? – CrazyCoder Feb 16 '17 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.. – KDecker Feb 16 '17 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](http://stackoverflow.com/a/11055250/104891). – CrazyCoder Feb 16 '17 at 23:48

1 Answers1

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

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904