Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Resources.getResource not found (Resources.getResource not found )
Resources.getResource not found [message #490026] Tue, 06 October 2009 20:27 Go to next message
JIA Pei is currently offline JIA Pei
Messages: 49
Registered: September 2009
Member


Eclipse can't find the specified resources by

"Resources.getResource" ....
What's wrong?

This seems always happens and it's absolutely annoying.

The thing is, I even added this resource directory into my project source.

What can I do??

Best Regards
JIA



Welcome to Vision Open
http://www.visionopen.com

[Updated on: Thu, 08 October 2009 01:43]

Report message to a moderator

Re: resources not found [message #490057 is a reply to message #490026] Wed, 07 October 2009 02:27 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.
Messages: 621
Registered: July 2009
Senior Member
JIA Pei wrote:
> Eclipse can't find the specified resources by
>
> "Resources.getResource" ....
> What's wrong?

I don't find this Resources class in SDK. Provided by 3rd party library?

- Prakash

Platform UI Team, IBM
http://blog.eclipse-tips.com
Re: resources not found [message #490252 is a reply to message #490057] Thu, 08 October 2009 01:57 Go to previous message
JIA Pei is currently offline JIA Pei
Messages: 49
Registered: September 2009
Member

Sorry, I'm actually building and testing
j3d-examples in Eclipse 3.5.1 IDE, under WindowsXP.

Resources is actually defined as the attached file. In fact, this Resource.java file is as simple as

package org.jdesktop.j3d.examples;

import java.net.URL;

/**
 * 
 */
public class Resources {
    
    /**
     * Do not construct an instance of this class.
     */
    private Resources() {
        
    }

    /**
     * Return the URL of the filename under the resources directory
     */
    public static URL getResource(String filename) {    
         URL url = Resources.class.getResource(filename); 
         return url;
    }
    
    
}




I tacked into the source, it seems the function

public java.net.URL getResource(String name)


in class

java.lang.Class


can't find the resource files, which makes url in

URL url = Resources.class.getResource(filename); 


always be null.

Can you please help?

Cheers
JIA Pei


Welcome to Vision Open
http://www.visionopen.com
Previous Topic:breakpoints in java debug aren't working
Next Topic:[CVS] undo "Mark as Merged"
Goto Forum:
  


Current Time: Sun Aug 31 06:34:12 EDT 2014

Powered by FUDForum. Page generated in 0.01626 seconds