Creating a JAR in Eclipse...can't access files in the JAR properly.

Hi all! I'm a newbie at JAR creation, and am having troubles. I have a project that loads images from image files in my project. I can create the JAR and all, and it runs, but the buttons that have ImageIcons with those IO loaded images are blank. I've tried to include the images when creating the JAR, but it keeps acting like the images never existed. When I run the JAR and have the images separately included in the directory (instead of packing them up too), it won't work as well...UNLESS those images are put in my $HOME directory (Linux).
Does anyone know how I can properly refer to the images that I'm trying to pack into the JAR from within the JAR? Or, is there a way for the JAR to understand where those images are supposed to be (redirect the focus from the $HOME directory to the JAR's directory)? Any help would be greatly appreciated! :)
-Keith

Hi,
Can the user execute the program through explorer? In Windows Server 2003, the Users group does not have Read and Execute permissions to the command processor (Cmd.exe). 
You could refer to the article below to resolve the issue:
"Access is denied" error message when you run a batch job on a Windows Server 2003-based computer
http://support.microsoft.com/kb/867466
Best Regards,
Mandy 
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place.

Similar Messages

  • Accessing files outside the jar

    Greetings,
    I've got a jar file with some classes, which is in a directory. In this dir there are also some resources. How to access those resources from inside the jar?
    Thanks in advance,
    imaginner

    Try this...
    In your class, add this line...
    String path = System.getProperty("user.dir");
    it will give the path of the folder from which you are running
    your jar file. To this path, add your properties file name
    and start reading it.....
    For example:
    If i have a properties file which both :
    1) should be able to read and edit by users and
    2) should be accessible by classes in jar file....
    I would use the above concept like this.... in my class.....
    String path = System.getProperty("user.dir");
    Properties props = new Properties();
    props.load(new FileInputStream(path+"yourPropertiesFileName"));
    Hope it helps...
    Vijay

  • User with admin rights can't access files through the command prompt

    I have a strange situation where I have 2 users both setup exactly the same with admin rights on a 2003 (32 bit) server through an AD group membership, but one can do everything as expected but the other can't.
    The one that can't is trying to execute a program is a command prompt and keeps getting access denied or invalid directory when trying to cd into the folder.   I double and tripled check the permissions and they are correct, this person should have
    full admin.  In fact I did a effective permissions through explorer and it states full rights.  Along those lines this person can also access the folder in question through explorer just not a command prompt. 
    Has anyone seen this before ? and if so what can be done about it.
    Thanks

    Hi,
    Can the user execute the program through explorer? In Windows Server 2003, the Users group does not have Read and Execute permissions to the command processor (Cmd.exe). 
    You could refer to the article below to resolve the issue:
    "Access is denied" error message when you run a batch job on a Windows Server 2003-based computer
    http://support.microsoft.com/kb/867466
    Best Regards,
    Mandy 
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Creating a photo book, How can I access / view all the versions?

    I used 247 versions to create a book in Aperture 3.5.1. I am reviewing the book. Only 93 versions are now displayed! I cannot access/view the other ones. Up to friday it was fine. What happens? How do I solve this issue?

    You can not - they are soreted by date
    --  the only solution I have seen is to put them in an album sorted the way you and and then use the batch cnage command to redate them with a small invrement between so a data sort matches your desired sort  --  I personally do not want to redate a bunch of my photos nor do i want  to have to go through and un-re- date a bunch
    suggest a change to Apple - iPhoto menu ==> provide iPhoto feedback
    LN

  • Java Files inside the jar file cannot be read or accessed through Eclpse

    The Java File inside the jar file of the eclipse cannot be accessed through the Eclipse . It shows error for the modules in the jar file .
    But when compiled with adding the jar files to the class path the compilation is successful .
    How can i browse through the files in the jar like going into the function definition .
    TIA ,
    Imran

    Open MPlayer OSX and show the playlist (command-shift-p) then drag the file into the playlist. Click the file in the playlist and click the "i"nfo button. What does it list for file, video and audio format?
    Not all of the codecs used in avi and wmv files are available for OS X so I'm guessing your file happens to be using one that isn't...

  • Please Help java.policy signedBy can't access file local

    i create keystore and signjar in web applet
    run tomcat access file in local but not acess file denied
    i goto edit file java.policy
    grant {
         permission java.security.AllPermission;
    can access file
    but put SignedBy cannot access file
    grant SignedBy fuangchai{
         permission java.security.AllPermission;
    Please help me example file keystore,applet.jar,java.policy
    to signedby access file local in webapplet
    env JDE 1.5 ,javascript yui 2.8 ,prototype js,tomcat6
    File html
    <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
    codebase="http://java.sun.com/update/1.5.0/jinstall-1_5-windows-i586.cab#Version=5,0,0,5"
    width="1" height="1" >
    <param name=code value="com.arg.aes.test.FileDirectoryBS.class" >
    <param name=archive value="app.jar">
    <param name=codebase value="." >
    <param name="type" value="application/x-java-applet;version=1.5">
    <param name="scriptable" value="true">
    <param name="mayscript" value="true">
    <param name="debug" value="false">
    <comment>
    <embed name="myApplet" id="myApplet"
    type="application/x-java-applet;version=1.5"
    code="com.arg.aes.test.FileDirectoryBS.class"
    archive="app.jar"
    java_codebase="."
    width="1"
    height="1"
    scriptable="true"
    mayscript="true"
    pluginspage="http://java.sun.com/products/plugin/index.html#download">
    <noembed>
    </noembed>
    </embed>
    </comment>
    </object>
    <applet
    code="com.arg.aes.test.FileDirectoryBS"
    width="1"
    height="1"
    archive="app.jar"
    name="myApplet"
    codebase="."
    MAYSCRIPT="true"
    >
    </applet>
    javascript
    initlistfile : function() {
              try
                   var list = $("myApplet").initlistfileInDir();     
                   var jsondata = list.evalJSON();
                   /*alert(jsondata.dirname);
                   alert(jsondata.dirpath);
                   alert(jsondata.listfile.length);*/
                   initTableLeft(jsondata.listfile);
              catch(e)
                   alert("Exception : access denied.");
                   return;
    import java.applet.Applet;
    import java.io.File;
    import java.security.Permission;
    import java.security.PermissionCollection;
    import java.security.Policy;
    import java.security.ProtectionDomain;
    import java.text.DecimalFormat;
    import java.text.NumberFormat;
    import java.util.ArrayList;
    import java.util.Enumeration;
    import java.util.List;
    * @author fuangchai
    public class FileDirectoryBS extends Applet{
    public static File[] ROOTS = File.listRoots();
    public static String HOME = System.getProperty("user.home");
    public String listDir()
    return JsonObj.makeTopDir((ROOTS.length > 0)?ROOTS : new Object[]{HOME});
    public String initlistfileInDir()
    return listfileInDir(null);
    public String listfileInDir(String dirName)
    if(null == dirName || dirName.equals(""))
    System.out.println("root = " + ROOTS.length);
    try {
    dirName = (ROOTS.length > 0)?ROOTS[0].getPath():HOME;
    catch (Exception e) {
    e.printStackTrace();
    return "";
    System.out.println("#########################");
    DirectoryDescImp obj = makeObjDir(dirName);
    return (null == obj)?null:JsonObj.makeDir(obj);
    public String listlinkInDir(String dirName)
    if(null == dirName || dirName.equals(""))
    System.out.println("root = " + ROOTS.length);
    try {
    dirName = (ROOTS.length > 0)?ROOTS[0].getPath():HOME;
    catch (Exception e) {
    e.printStackTrace();
    return "";
    System.out.println("#listlinkInDir#");
    try {
    File obj = new File(dirName);
    return (null == obj)?null:JsonObj.makelinkDir(obj.getName(),obj.getPath());
    } catch (Exception e) {
    System.out.println("I can't access a file here! Access Denied!");
    e.printStackTrace();
    return null;
    public boolean isEnc(File f)
    //TODO
    return false;
    public DirectoryDescImp makeObjDir(String dirName)
    System.out.println("dirName = " + dirName);
    try{
    File dir = new File(dirName);
    String[] entries = dir.list();
    if(null == dir || null == entries || entries.length <= 0)
    System.out.println("Data is null or not obj." );
    return null;
    System.out.println("Dir List = " + dir.list().length);
    System.out.println("Dir Name = " + dir.getName());
    System.out.println("Dir Path = " + dir.getPath());
    DirectoryDescImp dirDesc = new DirectoryDescImp();
    dirDesc.setDirName(dir.getName());
    dirDesc.setDirPath(dir.getPath());
    List<FileDescImp> list = new ArrayList<FileDescImp>();
    for(int i=0; i < entries.length; i++) {
    File f = new File(dir, entries);
    FileDescImp fDesc = new FileDescImp();
    fDesc.setFile(f);
    fDesc.setFileEncrept(isEnc(f));
    list.add(fDesc);
    dirDesc.setListfile(list);
    return dirDesc;
    catch(Exception e){
    System.out.println("I can't access a file here! Access Denied!");
    e.printStackTrace();
    return null;
    Thank you
    Fuangchai Jum
    Mail [email protected]
    Edited by: prositron on Jan 13, 2010 7:35 AM

    OK,
    Let's say I have to intialize Environment, and call method initEnvironment() in Applet's init(). Environment class:
    class Environment
         private KeyStore keyStore;
         private Enumeration<String> aliases;
         public void initEnvironment() {
              Security.addProvider(new sun.security.mscapi.SunMSCAPI());
              keyStore = KeyStore.getInstance("Windows-MY");
              keyStore.load(null);
              aliases = keyStore.aliases();
    }Applet is signed, I trust signer.
    Since Applet is signed I'm able to overwrite existing .java.policy under user.home.
    This doesn't work if I don't have .java.policy:
    grant {
      permission java.security.SecurityPermission "insertProvider.SunMSCAPI";
      permission java.security.SecurityPermission "authProvider.SunMSCAPI";
      permission java.util.PropertyPermission "jsr105Provider", "read";
      permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.pipe.Fiber.serialize", "read";
      permission java.lang.RuntimePermission "setContextClassLoader";
      permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.noPool", "read";
      permission java.lang.RuntimePermission "accessDeclaredMembers";
      permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
      permission java.lang.RuntimePermission "accessClassInPackage.com.sun.xml.internal.ws.fault";
      permission java.util.PropertyPermission "com.sun.xml.internal.ws.api.streaming.XMLStreamWriterFactory.woodstox", "read";
    };P.S.
    Does it make sense to be able to make changes to file system and not be able to make actions from above policy?!?!

  • Can't Access files in file manager

    I can't access any of the files on my nokia 5530 memory card through the file manager. The music player still displays and plays all the music files which are on the memory card. But image gallery doesn't display memory card pictures anymore.And I can view all the folders on the memory card when I connect the phone to my pc using pc suite.Any solutions?thanks in advance.

    Scan your PC with latest updated Antivirus.
    [That virus will hide your important folders (and duplicate them with extension name) which symbian os will not show in its filemanager or gellary (any hidden files or folder)]
    after that connect your phone to pc in mass storage mode and scan your meory card
    Set your windows explorer to show hidden files and folders
    explore your memory card and goto the property of your  folders( where your datas are stored)
    uncheck Hidden and click on apply
    somtimes it becomes unable to unchck Hidden checkbox
    in such a situation,
    open that folder and copy necessary files
    delete the folder and create new one with same name
    paste the recently copied files back to the folder
    now your phone should read datas on your memory card in file manager or gellary too.
    if applications installed on memory card  are readily available for reinstallation and your datas are successfully backed up, best way to get rid of that problem is to format memory card either in phone or pc

  • A flash game was accidently blocked on a website, and now I can't access any of the flash games on it. Can that website be unblocked?

    == Issue
    ==
    I have a problem with my bookmarks, cookies, history or settings
    == Description
    ==
    A flash game was accidentally blocked on the website http://www.oyunlar1.com Now I can't access any of the games there. Is there anyway to unblock the flash settings for that website?
    == Troubleshooting information
    ==
    Application Basics
    Name Firefox
    Version 3.6.7
    Profile Directory
    Open Containing Folder
    Installed Plugins
    about:plugins
    Build Configuration
    about:buildconfig
    Extensions
    Name
    Version
    Enabled
    ID
    1-ClickWeather 1.1.9.1 true
    Adblock Plus 1.2.1 true
    Adobe Contribute Toolbar 5.0 true {01A8CA0A-4C96-465b-A49B-65C46FAD54F9}
    AIM Toolbar 5.96.5.1 true
    Ask Toolbar for Firefox 2.1.0.5 true
    BatchDownload 1.2.4 false [email protected]
    Big Fish Games Toolbar 2.0.0 true {6847DFAE-037A-400c-A524-27F0A281B692}
    CheckPlaces 2.2.2 false [email protected]
    Cooliris 1.12.0.36949 true [email protected]
    DownloadHelper 4.7.4 true
    DownThemAll! 1.1.10 true
    Fast Video Download (with SearchMenu) 3.1.1 true
    Fast Youtube Downloader 1.2.2 true [email protected]
    Firefox ImageGrabber 1.0.6 false {546d2a00-2bbf-11dc-8314-0800200c9a66}
    Flashblock 1.5.13 false {3d7eb24f-2740-49df-8937-200b1cc08f8a}
    FlashGot 1.2.1.27 true {19503e42-ca3c-4c27-b1e2-9cdb2170ee34}
    FoxyProxy Standard 2.21.3 true [email protected]
    Google Toolbar for Firefox 7.0.20100326W true {3112ca9c-de6d-4884-a869-9855de68056c}
    Googlepedia 0.6.3 true {1ABADB6E-DC4B-11DA-9F70-791A9CD9513E}
    HP Smart Web Printing 4.60 false [email protected]
    ImageHost Grabber 1.6.4 true
    InvisibleHand 2.4 true [email protected]
    iWinGames Plugin 1.0 false {98e34367-8df7-42b4-837b-20b892ff0847}
    Java Console 6.0.07 true
    Java Console 6.0.04 true
    Java Console 6.0.10 true
    Java Console 6.0.12 true
    Java Console 6.0.13 true
    Java Console 6.0.14 true
    Java Console 6.0.15 true
    Java Console 6.0.17 true
    Java Console 6.0.16 true
    Java Console 6.0.19 true
    Java Console 6.0.20 true
    Java Quick Starter 1.0 true [email protected]
    MegaUpload DownloadHelper 1.0.2 true [email protected]
    Microsoft .NET Framework Assistant 1.2.1 true {20a82645-c095-46ed-80e3-08825760534b}
    MSN Toolbar 4.0 false [email protected]
    myBabylon English Toolbar 2.6.0.15 true
    myibay Firefox extension 1.1.7 true [email protected]
    NoScript 1.10 false {73a6fe31-595d-460b-a920-fcc0f8843232}
    Ookong 1.5 true {95969329-aa35-473a-b537-3f6f62c0ba23}
    Rapidlibrary Search ToolBar 1.0.0 true {2832ABCD-4444-1012-2D45-132D5447C445}
    RapidShare DownloadHelper 1.0 false [email protected]
    RDown - Rapidshare Downloader 0.6.0 true dave2x@download
    Remove It Permanently 1.0.6.7 true {1dbc4a33-ea62-4330-966c-7bdad3455322}
    RSFind! 1.1.2 false [email protected]
    Search Helper Extension 1.0 true {27182e60-b5f3-411c-b545-b44205977502}
    Shareaholic 1.9.9.5 true [email protected]
    SkipScreen 0.4.12s false SkipScreen@SkipScreen
    Skype extension for Firefox 2.2.0.102 false
    Status-bar Scientific Calculator 4.9.2 true ststusscicalc@sunny
    StumbleUpon 3.64 true
    The Browser Highlighter 1.0.19126 false [email protected]
    UnPlug 2.026 true unplug@compunach
    Xmarks 3.7.9 true [email protected]
    Yahoo! Toolbar 2.1.3.20100310105313 true {635abd67-4fe9-1b23-4f01-e679fa7484c1}
    Adobe DLM (powered by getPlus(R)) 1.6.2.63 true
    Modified Preferences
    Name
    Value
    accessibility.typeaheadfind.flashBar 0
    browser.fixup.alternate.enabled false
    browser.history_expire_days.mirror 180
    browser.places.smartBookmarksVersion 2
    browser.startup.homepage http://www.refdesk.com/
    browser.startup.homepage_override.mstone rv:1.9.2.7
    extensions.lastAppVersion 3.6.7
    general.useragent.extra.microsoftdotnet ( .NET CLR 3.5.30729; .NET4.0E)
    javascript.options.showInConsole true
    keyword.URL http://slirsredirect.search.aol.com/slirs_http/sredir?sredir=2706&invocationType=tb50-ff-aim-ab-en-us&query=
    network.protocol-handler.warn-external.aim false
    network.protocol-handler.warn-external.dnupdate false
    places.last_vacuum 1279652142
    privacy.sanitize.migrateFx3Prefs true
    security.warn_viewing_mixed false
    == Firefox version
    ==
    3.6.7
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7 GTB7.0 ( .NET CLR 3.5.30729; .NET4.0E)
    == Plugins installed
    ==
    *-Cooliris embedded in a tab
    *getplusplusadobe16263
    *np-mswmp
    *Contribute Firefox IBE Plugin DLL
    *6.0.12.69
    *RealPlayer(tm) LiveConnect-Enabled Plug-In
    *1.9.0009.1
    *npdnu
    *npdnupdater2
    *NPTURNMED
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.3"
    *Default Plug-in
    *Shockwave Flash 10.1 r53
    *BrowserPlus -- Improve your browser! -- http://browserplus.yahoo.com/
    *Adobe Shockwave for Director Netscape plug-in, version 11.5
    *Delivery Network Acceleration by BitTorrent™
    *GEPlugin
    *Picasa plugin
    *4.0.50524.0
    *MSN® Toolbar
    *Windows Presentation Foundation (WPF) plug-in for Mozilla browsers
    *Google Updater pluginhttp://pack.google.com/
    *Google Update
    *Java(TM) Platform SE binary
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *Npdsplay dll
    *DRM Store Netscape Plugin
    *DRM Netscape Network Object

    Thanks, Eric. I'm not sure what I should be checking using your suggestion--as I said, I'm an utter novice with the iMac. However,  I saw a reference to problems with the Library entries, so I checked mine and the iWork files were missing, something confirmed when I checked the crash log. In desperation, I did another software update, and that seems to have fixed the problem completely. Now wondering if I dare upgrade to Lion!

  • How can I access files from a flash drive that were previously saved using a Windows computer? When I attempt to open the file on MacBook Pro, it is asking to "convert file to"; I also have Microsoft Word installed on the Mac as well.

    How can I access files from a flash drive that were previously saved using a Windows computer? When I attempt to open the file on MacBook Pro, it is asking to "convert file to"; none of the options I choose work. I also have Microsoft Office (with Word) installed on the Mac as well.

    Format the external drive as FAT32 or ExFAT. Both computers will then be able to read and write to it.

  • How can I access files that I moved from an older MacBook Pro to a newer one via Firewire and Migration assistant.  The files show up on the new MacBook but cannot be opened.  Thanks!

    How can I access files that I moved from an older MacBook Pro to a newer one via Firewire and Migration assistant?  The files show up on the new MacBook but cannot be opened.  Thanks!

    Get info then check permissions then add your curent user name (it was probably different on old Mac) and give your username full read/write permissions.

  • I saved a spreadsheet to iCloud now I can not access it.  The message I get say I need a newer version of Numbers but I already have it.  How do I get access to my document on iCloud?

    I saved a spreadsheet to iCloud now I can not access it.  The message I get says I need a newer version of Numbers but I already have it.  How do I get access to my document on iCloud?

    Please see this user tip:
    Need newer version of Numbers to open file

  • After trying to change permissions on my computer so others on my network can access files, my external Hard Drive has a lock on it and I can't access files. I've tried repairing permissions, logging in under another Administrator account, using Terminal

    After trying to change permissions on my computer so others on my network can grab files, my external Hard Drive has a lock on it and I can't access files. I've tried repairing permissions, logging in under another Administrator account, using Terminal to fix the problem, downloaded BatChmod but nothing works… Any other suggestions? I have an Imac running OS10.6.8.

    There is suddenly a lock icon on my external backup drive!
    Custom Permissions

  • In Aperture 3, how can I easily move entire projects out of my main Ap Library into other libraries?  My Ap library is running super slow because it's overloaded l so I have created two new libraries, but can't seem to move the projects into them

    In Aperture 3, how can I easily move entire projects out of my main Ap Library into other libraries?  My Ap library is running super slow because it's overloaded, so I have created two new libraries, but can't seem to move the projects into them?

    Hello Annabel,
    To move entire projects export them as Aperture Libraries, and then import those Libraries into the other Aperture Library:
    Select the Project in the Inspector, then
    File -> Export -> Project as Library
    In the other Library do:
    File -> Import  -> Library/ Project
    But I am not quite convinced, that the size of your current Aperture Library is responsible for the slowness of Aperture - Aperture is designed to cope with huge libraries.
    You may want to post your hardware setup and details of your library, and some of the hardware experts here may help you to find the reason for the slowness.
    A huge library should only be a problem, if the projects are too big, and if you have many, many smart albums at the root level of your library.
    So keep the projects small, and try to move some of your smart albums to lower levels in your folder structure (then Aperture does not need to scan all of your images to build the smart album).
    Other reasons for Aperture's slowness may be, e.g.
    An overfull system drive and/or external drive (keep at least 20% of your drives empty)
    lack of RAM
    a corrupted Aperture Library, that needs repairing
    Have you checked those options, before you split your library? It would be a pity to split it, for you would loose the ability to browse all parts at the same time, to use all your images in the Media Browser, etc.
    Regards
    Léonie

  • HT4623 after I updated my iPhone 4 to iOS 6.1 I can't access my WiFi (The greyed out Wi-Fi button)

    after I updated my iPhone 4 to iOS 6.1 I can't access my WiFi (The greyed out Wi-Fi button)

    Most likely the iphone was hacked to unlock it from the original carrier
    updating the iOS will relock a hacked iPhone to that Carrier

  • How can I access and use the alphabetical keyboard of the phone ?

    How can I access and use the alphabetical keyboard of the phone ? I cannot find the answer in the manual of use.  Thanks for your help !

    Recently I was abroad and tried to contact my voicemail to check my messages. I was asked to enter a password and did not know how to use the letters below the figures on the keyboard.  I had to give up and wait until I was back in my country (no password is then needed).

Maybe you are looking for