BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

getClassLoader does'nt find the file

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI
View previous topic :: View next topic  
Author Message
Guy Perron
Guest





PostPosted: Wed Oct 08, 2003 10:19 pm    Post subject: getClassLoader does'nt find the file Reply with 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.


Back to top
Lori M Olson (TeamB)
Guest





PostPosted: Thu Oct 09, 2003 4:51 am    Post subject: Re: getClassLoader does'nt find the file Reply with quote



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





PostPosted: Thu Oct 09, 2003 7:12 am    Post subject: Re: getClassLoader does'nt find the file Reply with quote



"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> JBuilder JavaAPI All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.