• Post Reply Bookmark Topic Watch Topic
  • New Topic

Classloader.getSystemResource unable to find db.db when using jar

Raymond Ng
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program calls Classloader.getSystemResource("db.db"), and it's unable to find the db.db file if it's outside the jar. The db.db file is in the same folder as the Client.jar. Even if i set the classpath using -cp, it still can't find the file. But when I insert the db.db file anywhere inside the jar file, it's able to find it without problems.
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!