Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

getting resource from jar on classpath

800455Jun 17 2008 — edited Jun 17 2008
I have xml file in a folder
com/console/core/resources/cameo.jrxml
which is included in a jar file and the jar file is on the classpath.

i'm trying to load the resource like this
    String file = "/com/console/core/resources/cameo.jrxml" ;
    InputStream in = CustomForm.class.getResourceAsStream( file );
but i get an exception about MaformUrL. how do i get the file as a resource since i have to put it into the jar file to deploy
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 15 2008
Added on Jun 17 2008
14 comments
2,284 views