• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

started using a package, now compiler can't find classes

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've put a package line into all of my classes, and now the classes can't find each other. I'm putting some static methods in a utilities class (is this correct design?). Here's the error:
cfFile.java [44:1] cannot resolve symbol
symbol : variable utilities
location: class com.wallinternet.cfBrowser.cfFile
code = utilities.readFile(newfile);

Thanks,
Justin
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The compiled class files need to reside in a directory structure that matches the package declaration and the root of the directory structure needs to be findable (if that's a word - probably not) through the classpath. Is the idea of adjusting the classpath new for you?
 
J. Wall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My directory structure is this:
E:\javawork\com\wallinternet\cfBrowser\
My package line reads:
package com.wallinternet.cfBrowser;
(as long as I comment this out, everything complies)
My main method is in cfParser.java in the cfBrowser directory
I'm using NetBeans, so my classpath are the mounted directories and Jars. I've mounted E:\javawork\com\wallinternet\cfBrowser\ along with 2 jars and a directory that holds files I'm parsing. Maybe I should have the properties of the last directory set false for use in execution, compiling, and debugging....
Thanks for the help,
Justin

Originally posted by Dirk Schreckmann:
The compiled class files need to reside in a directory structure that matches the package declaration and the root of the directory structure needs to be findable (if that's a word - probably not) through the classpath. Is the idea of adjusting the classpath new for you?

 
J. Wall
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You gave me the right idea, Thanks! I had to mount (add to classpath) the com directory, not the cfBrowser directory.

Originally posted by Dirk Schreckmann:
The compiled class files need to reside in a directory structure that matches the package declaration and the root of the directory structure needs to be findable (if that's a word - probably not) through the classpath. Is the idea of adjusting the classpath new for you?

 
Do not set lab on fire. Or this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic