Board index » jbuilder » getClassLoader does'nt find the file

getClassLoader does'nt find the file


2003-10-09 06:19:20 AM
jbuilder4
With JBuilder7,
I try do
URL url = getClass().getClassLoader().getResource("a file that is in the
same directory as the.jpx file");
and I always get a null pointer for url. The same code is working with
Eclipse, and BlueJ but it does'nt work in Jbuilder.
Anybody as an idea why and what am I missing with JBuilder.
THanks ,
Guy Perron.
 
 

Re:getClassLoader does'nt find the file

Guy Perron wrote:
Quote
With JBuilder7,
I try do
URL url = getClass().getClassLoader().getResource("a file that is in the
same directory as the.jpx file");
and I always get a null pointer for url. The same code is working with
Eclipse, and BlueJ but it does'nt work in Jbuilder.
Anybody as an idea why and what am I missing with JBuilder.
THanks ,

Guy Perron.


Because the file needs to be in the same directory as the jbuilder
executable for that kind of call to work.
--
Regards,
Lori Olson (TeamB)
------------
Save yourself, and everyone else, some time and search the
newsgroups and the FAQ-O-Matic before posting your next
question.
Google Advanced Newsgroup Search
www.google.ca/advanced_group_search
Other Newsgroup Searches:
www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
www.visi.com/~gyles19/fom-serve/cache/1.html
 

Re:getClassLoader does'nt find the file

"Guy Perron" < XXXX@XXXXX.COM >writes:
Quote
URL url = getClass().getClassLoader().getResource("a file that is in the
same directory as the.jpx file");
That call will look for the resource at the root of the classpath,
i.e. the "classes" directory or any library defined for the project.
Quote
and I always get a null pointer for url. The same code is working with
Eclipse, and BlueJ but it does'nt work in Jbuilder.
Why do they place their project file in a dir placed on the classpath?
 

{smallsort}