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 Java in General and the fly likes Finding a file in classpath 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 » Java in General
Bookmark "Finding a file in classpath" Watch "Finding a file in classpath" New topic
Author

Finding a file in classpath

Nehal Dave
Greenhorn

Joined: Dec 22, 2000
Posts: 28
Hi
I need to know how can we validate an import statement.
For e.g
import com.javaranch.ABC;
I need to find out if com.javaranch.ABC class is present in my classpath.
Any ideas?
Thanks
Nehal.
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
You could try
Class.forName("com.javaranch.ABC")
or
ClassLoader.getSystemResource("com/javaranch/ABC")


"I'm not back." - Bill Harding, Twister
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Finding a file in classpath
 
Similar Threads
doPost() & doGet()
executing java program from java
how to add mail.jar to classpath?
how to import package
JSP +Bean/EJB