Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Errror while compiling:Package doesn't exist  RSS feed

 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am getting following error while compiling one of my java file which is in the particular package:
Package doesn't exist:com.oreilly.servlet.*;
import com.oreilly.servlet.*;
^

I want to know what are the possible cause it can be, apart from Classpath setting,because my classpath is properly set,having the jar(cos.jar) file where this package resides, in the CLASSPATH variable.
Please let me know.
Any help would be greatful.

Thank you.

***********************************
Tip: Modesty is all virtue.
***********************************
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using a web application, you should put cos.jar in your WEB-INF/lib directory.
 
Baseet Ahmed
Ranch Hand
Posts: 225
Java Notepad Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have already put the cos.jar in the WEB-INF/lib folder in my Web application.

Let me know other possiblities.



***********************************
Tip: Modesty is all virtue.
***********************************
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I've reread your post and realized that the error happened at compile time. Please send your command line when your compiling, and your CLASSPATH.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:
If you are using a web application, you should put cos.jar in your WEB-INF/lib directory.


Its a compilation error , WEB-INF/ lib is for runtime.At runtime the classloader looks for libraries there.

Try opening the cos.jar and check whether that jar really contains the class in the required package.

If you find that , its problem with CLASSPATH setting.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its a compilation error , WEB-INF/ lib is for runtime.

If you could also read my second post
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Satou kurinosuke:

If you could also read my second post


My BAD , Apologies.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!