File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getResourceAsStream i get null.

 
Frank Jacobsen
Ranch Hand
Posts: 358
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a resource that i want to read in my main program, but i get null.

I have tryed to put the xlsx "xl 2007" in the same directory as my java main program, but still i get null.

Any god ideas out there ?



I running on a ubunto mashine.


Frank
 
Rob Spoor
Sheriff
Pie
Posts: 20388
46
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With the first line you should put the .xlsx file in the same folder as the PIOExample.class file. If that's inside a JAR file then the .xlsx file should go in that JAR file as well.
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think getResourceAsStream() method should be used when reading from .jar files. Try using plain java.io.File, FileReader and stream objects.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic