This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes when i compile import file its showing error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "when i compile import file its showing error" Watch "when i compile import file its showing error" New topic
Author

when i compile import file its showing error

saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
I putted a.java,b.java file into com.example.servlets using package
i compiled a.java its compiling Note:it is package file
i compiling b.java its showing below error Note:it is import from package

location: package com.example.servlets
com.example.servlets.HelloEvents h=(com.example.servlets.HelloEvents)obj;
^
AutoServlet.java:38: cannot find symbol
symbol : class HelloEvents
location: package com.example.servlets
com.example.servlets.HelloEvents h=(com.example.servlets.HelloEvents)obj
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41123
    
  45
What is the exact command you're using to compile? Is the HelloEvents class in your classpath?

I'll move this to more a appropriate forum, since this has nothing to do with servlets, but with basic compilation and classpath issues.


Ping & DNS - my free Android networking tools app
saravanan rajendran
Ranch Hand

Joined: Jun 13, 2008
Posts: 75
For compile: javac AutoServlet.java

showing this error

symbol : class HelloEvents
location: package com.example.servlets
com.example.servlets.HelloEvents h=(com.example.servlets.HelloEvents)obj;
^
AutoServlet.java:38: cannot find symbol
symbol : class HelloEvents
location: package com.example.servlets
com.example.servlets.HelloEvents h=(com.example.servlets.HelloEvents)obj;
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41123
    
  45
You may want to start by working through this: http://www.javapassion.com/handsonlabs/javaclasspath/index.html
 
Consider Paul's rocket mass heater.
 
subject: when i compile import file its showing error
 
Similar Threads
using package getting compiler error
Not able to COMPILE!!!
compiling package program error
how to compile
Help with Package understanding