Problem while reading the File in a eclipse Plugin application
Posted
by
Abhishek Choudhary
on Stack Overflow
See other posts from Stack Overflow
or by Abhishek Choudhary
Published on 2010-12-30T03:28:28Z
Indexed on
2010/12/30
3:54 UTC
Read the original article
Hit count: 472
I 've developed an eclipse plugin and in that I have a java file trying to read directories and then populate result accordingly. When I try to run the file from eclipse itself through Run>Java application , it gives me proper result but as soon as I try to run the same through Eclipse Application, it is throwing NullPointerException because unable to find the directory.
I tried the following ways- Suppose , I have a package as -
Package - com.test.abhishek.file.java.TestWork.java
Directories - com.test.abhishek.file.java.Dir1 com.test.abhishek.file.java.Dir2 Now in TestWork.java- InputStream is = LGHelpContentView.class.getResourceAsStream("/"+dirName);**
The above line is getting failed. How should I keep my directory and where so that it will run as an eclipse plug-in as well.
© Stack Overflow or respective owner