• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

source file intervisibility...

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Rancher
Posts: 5008
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic