This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes cannot find symbol - compiler error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

cannot find symbol - compiler error?

Anuradha Prasanna
Ranch Hand

Joined: Mar 09, 2006
Posts: 115
I have a java pgm, "test.java" in "C:\MyProjects\beerV1" folder



and the "BeerExpert.class" file in "C:\MyProjects\beerV1\classes\com\example\model" folder

which contains,

package com.example.model;



so when i try compiling the "test.java" as below i get the, "cannot find symbol" error as below,

C:\MyProjects\beerV1>javac -cp classes test.java
test.java:4: cannot find symbol
symbol : class BeerExpert
location: class test
new BeerExpert();

1 error

can anyone please tell me how to compile the "test.java" file, which uses the "BeerExpert.class" file?


SCJP 6.0 90%
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 20158
    
  46

Please do not crosspost -- it wastes people's time and effort.


http://www.coderanch.com/t/485864/Programmer-Certification-SCJP/certification/cannot-find-symbol-compiler-error

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
jQuery in Action, 3rd edition
 
subject: cannot find symbol - compiler error?
 
It's not a secret anymore!