I'm having a weird problem where programs I write in Netbeans compile and run fine in the IDE, but when I try to run it from the command line, it finds errors and won't compile. A class file in the same directory that my main class needs to instantuate and run isn't being 'seen' by the compiler and it throws the 'cannot find symbol' error. Both files are in the same directory and package, but the compiler doesn't see them. I even tried creating a dummy class setup just to test basic instantiation, and same thing. It won't find the separate class file in the same directory. What is wrong? Again, if I build it in Netbeans, it will run in Netbeans, but if I take the same code and edit it in notepad or textpad and compile at the command line, the compile fails. WTH???

Recommended Answers

All 4 Replies

Does your classpath include the directory with the same name as the top-level package?

No. I'm not really clear on wat class path is for. ProI had Java as part of my CS. Degree program but there were some topics we didn't go into much depth with.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.