 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guy Perron Guest
|
Posted: Wed Oct 08, 2003 10:19 pm Post subject: getClassLoader does'nt find the file |
|
|
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.
|
|
| Back to top |
|
 |
Lori M Olson (TeamB) Guest
|
Posted: Thu Oct 09, 2003 4:51 am Post subject: 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
http://www.google.ca/advanced_group_search
Other Newsgroup Searches:
http://www.borland.com/newsgroups/ngsearch.html
Joi Ellis's FAQ-O-Matic:
http://www.visi.com/~gyles19/fom-serve/cache/1.html
|
|
| Back to top |
|
 |
Tor Iver Wilhelmsen Guest
|
Posted: Thu Oct 09, 2003 7:12 am Post subject: Re: getClassLoader does'nt find the file |
|
|
"Guy Perron" <gperron (AT) cmontmorency (DOT) qc.ca> 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?
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|