Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-30-2007, 10:08 PM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
cannot find symbol class error
hi there ,
i am creating a min class that links several classes and i am doing the following



Code:
package javazoom.jl.decoder; public class Main { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Decoder d = new Decoder(); Header h = new Header(); } }
i am saving all the classes in the same folder , and i am having this error twice with each line that i creat an instance for a class

the errors are
(1)
cannot find symbol
symbol : class Decoder
location: class javazoom.jl.decoder.Main
Decoder d = new Decoder();
^
(2)
cannot find symbol
symbol : class Decoder
location: class javazoom.jl.decoder.Main
Decoder d = new Decoder();
^
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-30-2007, 11:09 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
The problem: Compiler can not find Decoder and Header classes.

The solution: You need to tell compiler where these classes.

If you are using command line javac tool then this will be more problematic. Check parameters of javac command. You will need to place these classes correctly to your classpath or show the place of these classes as classpath to the javac!

If you are using an IDE like Netbeans, all you need to do is to select Properties of the Project and add the jar containing these classes or the directory containing these classes using a dialog.. And IDE will inform the compiler itself automatically.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 10-31-2007, 12:06 AM
ShoeNinja's Avatar
Senior Member
 
Join Date: Oct 2007
Posts: 123
ShoeNinja is on a distinguished road
Send a message via AIM to ShoeNinja
From what you have posted, it is tough to tell where the problem would be. Is the main class in the same directory as the Decoder class? If it isn't, change your package statement at the top to import.
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 10-31-2007, 04:30 PM
Member
 
Join Date: Oct 2007
Posts: 11
po0oker is on a distinguished road
Thanks for the help guys but i couldn't figure out a solution

i have all the classes in the same folder , but how can i import a class in the main class ?
Bookmark Post in Technorati
Reply With Quote
  #5 (permalink)  
Old 10-31-2007, 04:51 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Ok create the following directory tree in the directory where you put your Main.class:

javazoom/jl/decoder

Into that directory, copy Header and Decoder classes and try to recompile.

So if the Main.class is inside c:/pooker directory then copy those classes to c:/pooker/javazoom/jl/decoder and go to c:/pooker again and type the following command to recompile your class:

javac -cp . Main.java

If it does not work let us know the error message you get.
Bookmark Post in Technorati
Reply With Quote
  #6 (permalink)  
Old 10-31-2007, 04:52 PM
ShoeNinja's Avatar
Senior Member
 
Join Date: Oct 2007
Posts: 123
ShoeNinja is on a distinguished road
Send a message via AIM to ShoeNinja
This might be a silly question, but have you checked your classpath? From looking at your code above, you're using some sort of IDE so it should be pretty easy to find. Just search the help docs for 'classpath.'
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Java Error: Cannot find Symbol... bobleny New To Java 8 04-15-2008 08:35 AM
Programm Error: cannot find symbol Help? junix New To Java 2 12-10-2007 07:30 AM
Error: cannot find symbol silvia New To Java 1 08-07-2007 07:39 AM
Error: cannot find symbol cachi AWT / Swing 1 08-06-2007 10:12 PM
Error: cannot find symbol constructor zoe New To Java 1 07-24-2007 10:24 PM


All times are GMT +3. The time now is 09:23 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org