Results 1 to 5 of 5
- 12-21-2011, 05:29 AM #1
Member
- Join Date
- Dec 2011
- Posts
- 5
- Rep Power
- 0
'error: cannot find symbol' please help
This may be stupid or old error but I search all threads and did all related task but still I have this problem 'error: cannot find symbol'
Main class :
package vilsoft.tree;
import java.applet.*;
import vilsoft.tree.*;
import java.awt.Container;
import javax.swing.*;
public class Main extends JApplet{
public void init()
{
Container content_pane = getContentPane ();
// Create an instance of DrawingPanel
int x=1000, y=1000;
content_pane.setSize(x, y);
Google amol=new Google();
content_pane.add(amol);
}
public void paint(){
}
}
Google class :
package vilsoft.tree;
import javax.swing.JPanel;
public class Google extends JPanel{
}
I put both .java files in same folder i.e. in /vilsoft/tree. When I compile and run through Eclipse, there is no error but when I am running through 'javac' it showing :
Main.java:19: error: cannot find symbol
Google amol=new Google();
^
symbol: class Google
location: class Main
Main.java:19: error: cannot find symbol
Google amol=new Google();
^
symbol: class Google
location: class Main
2 errors
Please help me..
- 12-21-2011, 07:42 AM #2
Re: 'error: cannot find symbol' please help
I have a feeling you're trying to compile from the wrong place. If your package is located at:
/someFolder/vilsoft/tree/Main.java
Then you need to cd to the someFolder dir to do the compile, not the tree folder:
cd /someFolder
javac vilsoft/tree/Main.java
Javac always needs to run from the root of the package and it needs the complete path to the file to compile relative to the current directory. That should work!
- 12-21-2011, 07:42 AM #3
Re: 'error: cannot find symbol' please help
FYI, you'll need to run it the same way too!
- 12-21-2011, 08:01 AM #4
Member
- Join Date
- Dec 2011
- Posts
- 5
- Rep Power
- 0
Re: 'error: cannot find symbol' please help
Yes..U r right... Its working now !! Thanx quad !
- 12-21-2011, 08:03 AM #5
Similar Threads
-
error: Cannot find symbol
By iswan in forum AWT / SwingReplies: 3Last Post: 09-30-2011, 04:02 PM -
Cannot Find Symbol error
By mrgreenacid in forum New To JavaReplies: 13Last Post: 05-16-2011, 07:28 AM -
Cannot find symbol Error
By new_Java in forum New To JavaReplies: 3Last Post: 02-17-2011, 11:23 PM -
cannot find symbol symbol :constructor Error. Please help! =(
By KalEl in forum New To JavaReplies: 9Last Post: 10-18-2008, 08:26 PM -
Error: cannot find symbol
By cachi in forum AWT / SwingReplies: 1Last Post: 08-06-2007, 08:12 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks