Problem accessing resources in a built jar but works fine within eclipse

Howdy,
I have an image which I am trying to set as my jframe icon, quick overview:
package: testpackage
source directory: src (in root dir of package)
image directory: icon (in root dir of package)
So if i do this to aquire the image, within the IDE it works fine!
Image image = Toolkit.getDefaultToolkit().getImage("icon/test.png");
However, if I export the jar file and try to run it, the image is not being found. I used jar xf to open the jar file and the relitive path is still the same "icon/test.png"...ive tried everything I can think of including just trying to move/include the image file in my source directory but no luck
FWIW when i right click on the image within eclipse and select "copy fully qualified name" i get a path like this:
/project/src/package/icon/test.png
Any ideas?
thanks

Try
Image image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("/icon/test.png"));

Similar Messages

  • EXCEL fails to Launch w/Report Generation Toolkit LV6.1 from a Built Application but works fine in full version

    In my developer version, I can generate reports that load up Excel and put the data in. When I build an application, it won't work. I don't get any errors and the code executes, but excel doesn't launch. I have the correct _excelsub.llb file for WindowsXP. It worked fine in Labview 6.0, but the same bld script with the new _excelsub won't work.

    You may want to try creating executables of one of the Excel example programs that comes with LabVIEW and see if they exhibit the same behavior. That will tell you if it's your code or something more specific to LabVIEW itself.
    J.R. Allen

  • Problem accessing VARRAY OF VARCHAR in 9i, but working in 8i

    The following code (modified sample ArrayExample.java for VARRAY
    OF VARCHAR) produces different results on a 8.1.7 and 9.0.1
    database. The standard way of accessing the members of an array
    of strings in the database:
    ARRAY array = ((OracleResultSet)rs).getARRAY (1);
    // get Array elements
    String[] values = (String[]) array.getArray();
    for (int i=0; i<values.length; i++)
    System.out.println(">> index "+i+" = "+values);
    seems not to work for strings in 9i. Instead it prints the byte
    representation of the strings ("0x313233" instead of "123").
    Code below shows, that using a workaround it is possible to
    access the string itself.
    Results of code below (always using the 9i JDBC driver).
    8i (correct):
    Row 1 :
    Array is of type SDMC_FS.STR_VARRAY
    Array element is of type code 12
    Array is of length 2
    index 0 = 123 =?= 123
    index 1 = 456 =?= 4569i (incorrect):
    Row 1 :
    Array is of type SDMC_FS.STR_VARRAY
    Array element is of type code 12
    Array is of length 2
    index 0 = 123 =?= 0x313233
    index 1 = 456 =?= 0x343536Whats wrong?
    br Thomas Spaarmann
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.oracore.Util;
    import oracle.jdbc.*;
    import java.math.BigDecimal;
    public class ArrayExample
    public static void main (String args[])
    throws Exception
    // Register the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
    // The sample retrieves an varray of type "NUM_VARRAY",
    // materializes the object as an object of type ARRAY.
    // A new ARRAY is then inserted into the database.
    String url = "jdbc:oracle:oci8:@";
    try {
    String url1 = System.getProperty("JDBC_URL");
    if (url1 != null)
    url = url1;
    } catch (Exception e) {
    // If there is any security exception, ignore it
    // and use the default
    // Connect to the database
    Connection conn =
    DriverManager.getConnection (url, "scott", "tiger");
    // It's faster when auto commit is off
    conn.setAutoCommit (false);
    // Create a Statement
    Statement stmt = conn.createStatement ();
    try
    stmt.execute ("DROP TABLE varray_table");
    stmt.execute ("DROP TYPE str_varray");
    catch (SQLException e)
    // the above drop statements will throw exceptions
    // if the types and tables did not exist before. Just
    ingore it.
    stmt.execute ("CREATE TYPE str_varray AS VARRAY(10) OF
    VARCHAR(256)");
    stmt.execute ("CREATE TABLE varray_table (col1 str_varray)");
    stmt.execute ("INSERT INTO varray_table VALUES
    (str_varray('123', '456'))");
    ResultSet rs = stmt.executeQuery("SELECT * FROM
    varray_table");
    showResultSet (rs);
    rs.close();
    stmt.close();
    conn.close();
    public static void showResultSet (ResultSet rs)
    throws SQLException
    int line = 0;
    while (rs.next())
    line++;
    System.out.println("Row "+line+" : ");
    ARRAY array = ((OracleResultSet)rs).getARRAY (1);
    System.out.println ("Array is of type
    "+array.getSQLTypeName());
    System.out.println ("Array element is of type code
    "+array.getBaseType());
    System.out.println ("Array is of length "+array.length());
    // get Array elements
    Datum[] values = (Datum[]) array.getOracleArray();
    String[] strValues = (String[]) array.getArray();
    for (int i=0; i<values.length; i++)
    String value = new String( values[i].getBytes());
    System.out.println(">> index "+i+" = "+value+" =?=
    "+strValues[i]);

    Are you including nls_charset11.zip (or nls_charset12.zip) in
    your CLASSPATH?
    Whenever a conversion into (or out of) a particular character set
    fails you may see a hex representation instead. By default the
    JDBC driver classes111/12 do not include the conversions
    required for the Windows character set.

  • Superdrive no longer recognizes CD, but works fine with DVD

    my Superdrive seems to have a problem recognizing any type of CD media, but works fine with DVD media.
    I reinstalled Leopard and still the same problem. I also zapped the NVRAM (this is an Intel 2.0 Ghz Mac Mini w/ 2 GB Ram.
    Is there anything else I can do or do I just need to replace the drive?

    Typically when this sort of symptom appears, it relates to a hardware failure, either due to a faulty lens, or dirt. You might try a lens cleaner to ensure it is not the latter.
    Since this is a 2.0GHz mini, it ought to be still under warranty - if that is the case it would be wise to have Apple, or an approved service provider, check it and undertake any necessary repairs.

  • When I enter my password to start my atv it tells me, that "there was a problem connecting to the network."  My Ipad works fine but not my new atv.  I have reset my password multiple times with no help.  I have also rebooted my wireless server.take it bac

    When I enter my password to start my atv it tells me, that "there was a problem connecting to the network."  My Ipad works fine in my house, but not my new atv.  I have reset my password multiple times with no help.  I have also rebooted my wireless server.  Do I take it back?

    Where is everyone????  Does anyone have an answer???
    Allik1

  • TS2972 First night I was able to watch 2 TV shows (45 min each) with no problems, but thereafter programs will not stream without constant pause to buffer. Weather conditions are ideal and my internet comes from crappy hugesnet, but worked fine the first

    First night I was able to watch 2 TV shows (45 min each) with no problems, but thereafter programs will not stream without constant pause to buffer. Weather conditions are ideal and my internet comes from crappy hugesnet, but worked fine the first night.

    The speed may have been ok at that time and is too inconsistent/too slow overall. interference may have proven to be more of an issue since as well. If using public DNS that will provide Intermittant results
    I'm sure using a hotspot would be fine but it depends on your viewing habits. An HD movie is around 4-5GB. It would also be subject to speed. requirements so best to test to see how it compares.
    You would have to check with your Carrier if hotspot it's enabled then just to into your settings and toggle it ON

  • HT1414 touch screen does not work on my ipod when playing music on itunes, but works fine on every other thing on ipod

    touch screen does not work on my ipod when playing music on itunes, but works fine on every other thing on ipod, can anyone help or what is the cause

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • My iphone5 wont charge with usb port but works fine with wall plug... Infact computer. Doesn't recognizes the iphone

    Battery not charging with usb port but works fine with wall plug.. So the prob is computer is not detecting the iphone5 . This problem started after upgrading to 6.1.3 version

    Try to see what happens on another computer. If it works on another computer, the issue is not at the iPhone.

  • People picker is not working for ie11 but working fine for other lower version

    i am using sharepoint 2010 and windows authentication
    recently i have updated my ie to ie11 and problem goes here.
    when i try to select from people picker, there are an unexpected error happened 
    however when i use other ie version, people picker work fine, what goes wrong?
    i have already added my system as trusted site
    if there any others thing i miss out?

    Hi,
    According to your post, my understanding is that People picker is not working for ie11 but working fine for other lower version.
    IE 11 is known to have compatibility issues on SharePoint 2010, please make sure to:
    first of all, try installing latest update for IE 11 (several compatibility issues were fixed since the first release)
    add the site to compatibility view (in IE> Tools> Compatibility view settings> type site name> add)
    add the site to trusted sites and set the zone security level to low (in IE> Internet Options> Security> trusted sites> sites>add your site there> ok> custom level> select low> reset> ok)
    You can use developer tools (f12) and set browser mode to the version that is most compatible with your environment.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Newest version of flash player not playing in newest version of google chrome but works fine in IE

    newest version of flash player not playing in newest version of google chrome but works fine in IE

    jennifer.jones214 wrote:
    In your  opinion, should I uninstall Firefox if I am installing Waterfox?
    Waterfox can coexist peacefully with Waterfox.  I have both installed, but never use Firefox any more.
    Not only can Waterfox run in 64-bit address space, it also is better optimized during compile time than Firefox.  (For obvious reasons; Firefox is compatible with many old systems, Waterfox only needs to be compatible with new 64-bit systems.)
    P.S. regarding Chris' advice above; Firefox and Waterfox use the same profile, so if that is actually the problem, then it will occur in both browsers.

  • I keep the itunes encountered a problem and needs to shut down . it was working fine until after i updated to 10.5 can someone plz help

    i keep the itunes encountered a problem and needs to shut down . it was working fine until after i updated to 10.5 can someone plz help

    I did get a "server busy" message when I loaded quicktime, but I'm not sure if it is related or not since I've been seeing that over the last couple of days, I can't remember if it came before iTunes stopped working or not. That message reads "This action cannot be completed because the other program is busy. Choose 'switch to' to activate the busy program and correct the problem." My options then are to choose switch to or retry. When I press "switch to" my Start menu opens, and nothing appears to happen when I select retry.
    that's an odd sort of a message (or series of messages).
    hmmmmm. let's try an experiment aimed at working out if there's a program interfering with the QuickTime (which is in turn causing grief with your iTunes).
    try a selective startup using MSCONFIG, with just the itunes and QuickTime background processes enabled, as per the following document:
    Using MSCONFIG to troubleshoot conflicts in Windows
    does QT open without the strange message after the selective startup?
    does iTunes launch properly?

  • HP ProBook 5220m Fan not working with battery power but work fine with adapter plugged in

    Hi,
    Any one have this issue?
    HP ProBook 5220m (Bios Version F50) Fan not working with battery power but work fine with adapter plugged in.
    This issue was found in my replacement motherboard. the original mother do not have this issue.
    The origianl mother to be replace is due to can't power on after a power failure recovery. I believe was due to power surge killed the motherboard's power controller circuitry.
    Appreciate any one can provide clue for resolving the problem.
    I have tried to install speedfan to try my luck, but it can't any fan in the application to configure. (Bios Version F50) 

    @wheng 
    ‎Thank you for using HP Support Forum. I have brought your issue to the appropriate team within HP. They will likely request information from you in order to look up your case details or product serial number. Please look for a private message from an identified HP contact. Additionally, keep in mind not to publicly post ( serial numbers and case details).
    If you are unfamiliar with the Forum's private messaging please click here to learn more.
    Thank you,
    Omar
    I Work for HP

  • IWork apps no longer sync with iCloud. I am on iOS 5.1,1, and this problem is several days old, before it was working fine. Anyone has an idea?

    iWork apps no longer sync with iCloud. I am on iOS 5.1,1, and this problem is several days old, before it was working fine. Anyone has an idea?

    Sadly this is not a new problem and I would not expect a forthcoming solution.  I bought an iPad 3G and the iWork suite at the end of August and iCloud syncing worked fine.  About the time Apple rolled out iOS 6 the syncing stopped working for me (without me upgrading or changing anything).  It has never really worked since.   Run iOS 5.1.1 on both the iPhone 4 and iPad 3G.  The "geniuses" claim that Apples iOS 5 requirement is not correct and that I MUST upgrade both to ios 6 (although I know for fact that lots of folks STILL have the iCloud probs even with its 6.  The last genius basically shrugged and non-verbally acknowledged the iCloud/iWork failing and suggested "just use Dropbox.". So why the **** did we pay for iWork!?!?!
    Basically the  iwork/iCloud Connnection is broken and I have yet to get a viable solution to repair the issue.  Sorry for the bad news.  For reference I have uninstalled/installed each iteration of iWork upgrades on each device without success.  I have reset all settings multiple times, turned iCloud off/on repeatedly etc etc without success.  I even wiped the iPad and restored from iCloud w/o intention (another Apple IPad "glitch" when I tried the "reset all settings" and the iPad decided to "erase all" instead.  The genius said "it happens.")
    Oddly, the Pages app is the only one that has marginally worked at times since the first probs.  However it is basically broken and non-functioning.  Certainly DO NOT trust vital documents to iCloud/iWork.  I lost a number of work critical docs in this whole annoying, messy process of trying to get what Apple promised as easy....

  • BPEL process fails in SOA (in UNIX), but works fine in SOA (in Windows) env

    Hello,
    BPEL process fails in SOA (in UNIX), but works fine in SOA (in Windows) environment
    Step 1: Build a asynchronous BPEL process which has no extra node. Make and deploy it in 'local windows desktop SOA' server
    The BPEL process has three nodes:
    a. client - on the left side of the swim lane
    b. receiveInput - first node in swim lane (client calls 'receiveInput')
    c. callbackClient - second and last node in the swim lane ('callbackClient' calls client)
    Step 2: Go to BPEL console and 'Initiate' the BPEL process -> 'Post XML Message'
    Step 3: Now, I can see the successfully completed BPEL instance in the BPEL console.
    Now,
    Step 4: Deploy the same BPEL process (dummy asynchronous) in the SOA server (hosted in unix box)
    Step 5: Go to BPEL console and 'Initiate' the BPEL process -> 'Post XML Message'
    Step 6: I find that the BPEL instance appears to have ended in error (on the second node i.e. callbackClient )
    With the following error message
    +<invalidVariables xmlns="http://schemas.oracle.com/bpel/extension"><part name="code"><code>9710</code>+
    +</part><part name="summary"><summary>Invalid xml document.+
    According to the xml schemas, the xml document is invalid. The reason is: Error::cvc-complex-type.2.4.b: The content of element 'DummyBPELProcessProcessResponse' is not complete. One of '{"http://xmlns.oracle.com/DummyBPELProcess":result}' is expected.
    Please make sure that the xml document is valid against your schemas.
    +</summary>+
    +</part></invalidVariables>+
    Has anyone faced similar issue as above ?
    i.e. process works find in windows environment (local SOA), but fails in SOA server in UNIX environment
    Appreciate your help in understanding this issue.
    Thanks,
    Santhosh

    Hello,
    The fix to this issue appears to have been as follows:
    +<schema attributeFormDefault="unqualified"+
    +     elementFormDefault="qualified"+
    +     targetNamespace="http://xmlns.oracle.com/DummyBPELProcess"+
    +     xmlns="http://www.w3.org/2001/XMLSchema">+
    +     <element name="DummyBPELProcessProcessRequest">+
    +          <complexType>+
    +               <sequence>+
    +                    <element name="input" type="string"/>+
    +               </sequence>+
    +          </complexType>+
    +     </element>+
    +     <element name="DummyBPELProcessProcessResponse">+
    +          <complexType>+
    +               <sequence>+
    +                    <element name="*:result*" type="string"/>+
    +               </sequence>+
    +          </complexType>+
    +     </element>+
    +</schema>+
    In DummyBPELProcess.xsd,
    modifiying "result" to ":result" appears to have resolved the issue in SOA under unix environment.
    If anyone can explain why "result" works in SOA under windows and ":result" works in SOA under unix environment, I would really appreciate your help.
    Thanks,
    Santhosh

  • I just installed CC Lr 5.5 and it will not open on my laptop but works fine on my desktop.

    I just installed CC Lr 5.5 and it will not open on my laptop, but works fine on my desktop.

    Try this:
    https://helpx.adobe.com/lightroom/kb/unable-launch-lightroom-55.html

Maybe you are looking for

  • NullPointerException at org.apache.crimson.parser.Parser2.parseInternal

    I've tried to use JavaTM API for XML Processing (JAXP), particulary default SAX parser, which is embeded into JAXP. I downloaded jaxp-1_1.zip file from http://java.sun.com/xml/download.html, extacted it and included crimson.jar, jaxp.jar and xalan.ja

  • Passport External Drive Issues

    Love, love, love my new iMac BUT... I am having a problem using my Passport external drive with it. It recognizes it, but every few minutes it will lose the contact and then give me an error message about not having removed the device properly. (I di

  • Using tha App for the Universal Crossword puzzle.

    The App will not recognize the server and I can't download puzzles. Other Apps will work such as News, Forms etc. I am on a wireless network and am using Windows 7. I am using a Officejet Pro 8500A A910

  • How to increment an element in an array and put it back in the same array?

    I have an array of values generated by another part of my program. My goal is to count the number of occurences for each integer value in the array and put these values in a new array. This new array will be a histogram of the input array. My approac

  • Layout in MIRO to be changed

    Hi ,      I want to change the variant in the screen MIRO ie to move the procurement doc column to the last is there any transaction which can do this please suggest