• Post Reply Bookmark Topic Watch Topic
  • New Topic

source file intervisibility...  RSS feed

 
Jan Kilander
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have two source files (.java and all) in the same folder, and when I try to compile the one containing main(), it screeches to a halt declaring itself unable to recognize a symbol, which is the name of a method which is declared in the other source file.

I've tried setting the CLASSPATH, including the name of the folder where my source files lodge, but that doesn't help one little bit.

Do I HAVE to contrive a package structure for these two files, or is there some less involved way of makeing the source files intervisible?


Come what may, and you all have a good day!


J
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

CLASSPATH points to classes (no surprise there), so pointing it to source files won't help.

Setting up a proper package structure would help, but the easiest would be to compile both files together (javac *.java).
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post the full text of the error message and the lines from your program that cause the error.
Does your classpath include a . (for current directory)
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!