Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when i compile import file its showing error

 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
saravanan rajendran
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to start by working through this: http://www.javapassion.com/handsonlabs/javaclasspath/index.html
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic