This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Finding a file in classpath

 
Nehal Dave
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could try
Class.forName("com.javaranch.ABC")
or
ClassLoader.getSystemResource("com/javaranch/ABC")
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic