• 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

Compilation Error: cannot resolve symbol

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

Consider this is simple examples.

i have created 2 class in the bin directory.

public class Example1 {
}
public class Example2{
Example1 ex1 = new Example1();
}

I tried to compile these 2 files.Example1 is compiled fine.
I tried to compile the class Example2 it giving compilation error:
cannot resolve symbol class Example1

Please help me out what the mistake i had done.Whats the reason for the compilation error?

Help me !

Thanks & Regards,
Prasath
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
both works fine my friend

i compiled both

check the spelling and character case
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If your current directory is one directory above "bin" and you say "javac bin/Example2.java", the compiler will not look in "bin" for Example1, and you'll get a compiler error. There are three ways to deal with this. First, you could compile with "bin" as your current directory. Second, you could tell the compiler that "bin" is a directory in which to find other classes:

javac -cp bin bin/Example2.java

Third, you could compile both files at once:

javac bin/Example1.java bin/Example2.java
[ October 07, 2005: Message edited by: Ernest Friedman-Hill ]
 
Prasath Thirumoorthy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank u very much Mr Ernest Friedman-Hill

regards,
Prasath
reply
    Bookmark Topic Watch Topic
  • New Topic