Help!! cannot find files outside class dir

Directory Structure:
App
|-src
|-classes
| |-App
| |-...Packages
|-resource
|- images
I am having problems finding the files in the resource directory from the classes in the classes directory.
Currently, I am trying:
InputStream is = ClassLoader.getSystemResourceAsStream("app.properties");
and running with: java -cp .;../resource App.MainClass
whats wrong? and Is it different if I use a JAR file?

I can only get it working if the "resource" directory is in amongst the packages
App
|- classes
| |- App
| �  |.. packages
| �  |- resource
|- src
and use :
InputStream is = ClassLoader.getSystemResourceAsStream("App/resource/app.properties");

Similar Messages

  • Video download from SD card 2 iPad 2 interrupted, file corrupted.  Cannot find file to delete.  Does not appear in Photos, or is not visible using Windows File Manager.  Consumed 2.5G of space!  Can anyone help

    Video download from SD card to iPad 2 interrupted,  corrupted.  Cannot find file to delete.  Does not appear in Photos, or is not visible using Windows File Manager.  Consumed 2.5G of space!  Can anyone help?

    Video download from SD card to iPad 2 interrupted,  corrupted.  Cannot find file to delete.  Does not appear in Photos, or is not visible using Windows File Manager.  Consumed 2.5G of space!  Can anyone help?

  • Help.  My ITunes library content vanished. Cannot find files anywhere .

    Help.  My ITunes library content has vanished. Cannot find files anywhere .  Still accessing store via my phone and all my purchases are there etc but on my laptop the library is empty.. I have AVG and have put Itunes as exception as read that might be an issue.  Im really not sure what to do .

    Hi sooz180,
    Welcome to the Apple Support Communities! I understand you can see all of your purchased music on your iPhone but the library on your computer in iTunes is empty. If the music was purchased from iTunes you can get this music back to your iTunes Library two different ways. You can either transfer purchases from the iPhone to the iTunes Library, or you can just download the music again from the Purchased section of iTunes. I will post the information on both ways to recover your purchased music below.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/ht1848
    Download past purchases
    http://support.apple.com/kb/HT2519
    I hope this helps,  
    -Joe

  • Java Error : cannot find symbol , symbol : class (jdk 1.6.0)

    Dear All,
    Please help me.
    I am running javac from a .bat file and i set the classpath in the bat file as follows.
    echo on
    :start
    set classpath = "C:\Program Files\Java\jdk1.6.0\bin;"
    set classpath = "C:\Program Files\Java\jdk1.6.0\jre\..\lib\tools.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\rt.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\i18n.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\sunrsasign.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\jce.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.6.0\jre\classes;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\ldapsec.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\mysql-connector-java-5.0.0-beta-bin.jar;C:\Program Files\Java\jdk1.6.0\jre\lib\ext\sunjce_provider.jar; C:\Program Files\Java\jdk1.6.0\ideset\system;C:\Program Files\Java\jdk1.6.0\ideset\system;C:\Program Files\Java\jdk1.6.0\studio\system;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\j2ee-1.3.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\jaas-1.0.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\autoload\activation.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\jms-1.0.2b.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\jta-spec1_0_1.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\autoload\mail.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\AbsoluteLayout.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\sql.jar;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\rowset.jar;C:\Program Files\Java\jdk1.6.0\studio\lib\ext\jdbc20x.zip;C:\Program Files\Java\jdk1.6.0\studio\modules\ext\servlet-2.3.jar;C:\Program Files\Java\jdk1.6.0\studio\beans\TimerBean.jar;c:\Program Files\Java\jdk1.6.0\ideset\tomcat401_base;C:\sms\com\;"
    cd C:\sms
    javac mainP.java
    pause
    i have few class files which are inherited to the main program using ' import com.Connection; '
    i am getting errors like
    mainP.java:482: cannot find symbol
    symbol : class Connection
    location: class mainP
    Connection connection = new Connection(ipAddress, port);
    I think it is because of some classpath error.
    please advice me.......
    Viju

    Actually, you have NO CLUE what he's trying to doActually he said what he is trying to do in his posting. It's no mystery. But that's all the information that's available. If you know something that isn't posted here why not say so?
    Your reply was a snide, rude, "You're stupid for doing it that way" answerMy reply was neither snide nor rude and implied none of what you impute to it. It was a proper and constructive suggestion. You are entitled to disagree with it, but that doesn't justify this immoderate outburst.
    Bottom line is, you chose to be nastyBottom line is you're just making this up. You are imputing motives to me without evidence. Don't do that.
    You are the type of person that makes searching forums and posting questions for assistance a near waste of time.I doubt that you'll find many regulars here that would agree with that assertion. When you have made over 16,000 posts here over ten years as I have, come back and we'll discuss it some more.
    Go back to grade school and ...I suggest you try it yourself. You're not adding anything except noise to the discussion. Try curbing your temper, and while you're at it have a good look at the Code of Conduct for these forums. You're verging on personal abuse here.
    And, additionally, I've used ANT in the past. Batch files are FAR AND AWAY easier to set up.In your opinion. I disagree entirely, and I have eleven years' experience with Java to back it up.
    As for CLASSPATH, I haven't done anything about setting it beyond installing the JDK since about 1999, and it has a dot in it as we speak.

  • Cannot find file #01, do you want to search?"

    We recorded a song yesterday and saved it as properly as the other sessions we also recorded. Today I want to open it, but it always says "Cannot find file #01, do you want to search?" But I've got the problem only with one file, the other songs are ok.
    The odd thing is: the file is there, also the tracks in the file and the recordings in the tracks appear. But the music inside the recordings is gone. Also the media file is empty. I'm quite desperate and my band will kill me. Can anybody help?

    Did you move the songs to the current folder AFTER you added them to iTunes? Sounds like you did. Big mistake. You may just have to delete you library and re-import them from the current folder. Once you've done that, leave the files where they are. iTunes can't track where you're moving your music to from one place to the next.

  • "Cannot find the main Class. Program will exit."

    Hi, I created a program, and I am trying to distribute it to other people in my office. I tried using both NetBeans 6.8/6.9 and eclipse. I exported to a single jar file. When I run this single .jar file, it runs perfectly. I sent it to one of my coworkers, and the message "Cannot find the main Class. Program will exit." popped up. I then had IT update his Java to 6.20 and it worked. The problem is that this program must be distributed to over 100 people, and I cannot have them each update their Java individually, nor will IT update everyone's on their own. They all have Java 4.XX I believe. Is there any way around this error that only happens on older versions of java? I have checked my manifest file and what not, as I said it runs on computers with Java 6.

    AndrewThompson64 wrote:
    Do you mean Java 1.4? It is best to be sure, so point some of the target machines at this page(1) to check.Yes, Sorry I meant 1.4.XX, I think they have 1.4.2_19.
    >
    >
    a) Ensure the code does not use functionality introduced in later versions, e.g. assertions, generics, for-each loops.. Using the [cross-compilation options of javac|http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html#crosscomp-options] will warn of those.
    b) Ensure the code does not use any classes, attributes or methods that were not available in the earlier version, then use the cross-compilation options of javac when compiling. Actually the second will alert of the first, so long as the -bootclasspath parameter is used with an appropriate rt.jar.I believe that everything is ok, unless some of the swing functions cannot be used in 1.4. Besides the swing functions (which I am not sure about) everything should be able to be used in 1.4
    Thank You

  • I photo freezes under 'cannot find file'

    When I open iphoto it works fine for a few seconds but then it freezes and says 'cannot find file .........'
    I then have to force quit because it says it's 'not responding'
    I don't know why the files have gone from iphoto because I can still find them if I search for them and they seem to be in the correct place.
    For the moment I cannot use iphoto at all so please help!
    Thanks
    Chloe

    Chloe
    When it says that it cannot find a file, does it mention the file types?
    Some other things to try:
    Rebuild the database. Hold down the apple and option (or alt) keys and launch iPhoto. Use the resulting dialogue to rebuild. Choose the top three options.
    Create a new account (systempreferences -> accounts) and see if the problem is repeated there. If it is, then a re-install of the app might be indicated. If it's not, then it's likely the app is okay and the problem is something in the main account.
    Regards
    TD

  • None of the links in my TOC or INDEX work. Cannot find file is the error message.

    The files are on a networked drive. Win7. FM 8. I've renamed files. Regenerated. Created a new book. Nothing works.
    I do have hyphens and underscores in the file names but no other special characters.
    Need help urgently.
    The error message is:
    Cannot find file named
      \SOL\Data\TechDocs\DRAFT\Shiva\OperatorManual\096-0461-001C-1.
                 fm.
                 Make sure that the file exists.
    Note that the TOC and INDEX are listed in the book w/o a path while the body chapter has the entire path (above) listed in the book view.
    Thanks

    IIRC, FM8 had an issue with a path having more than 5 (or 6?) sub-folders. Try bringing the files up a few levels or create a mapped network drive down to the lower levels.

  • Cannot find symbol symbol : class Item location: package platypos.services.

    Well, I am having a few problems getting this java file to compile.
    /home/brandon/Desktop/platypos/services/order/Seat.java
    package platypos.services.order;
    import platypos.services.order.Item;
    import java.util.Vector;
    public class Seat
        private int             _number;
        private Vector<Item>    _items  = new Vector<Item>();
        public static void main(String args[])
            System.out.println("Hello");
    }here is my terminal session:
    brandon@Aspire5100:~$ javac /home/brandon/Desktop/platypos/services/order/Seat.java
    /home/brandon/Desktop/platypos/services/order/Seat.java:17: cannot find symbol
    symbol  : class Item
    location: package platypos.services.order
    import platypos.services.order.Item;
                                  ^
    /home/brandon/Desktop/platypos/services/order/Seat.java:23: cannot find symbol
    symbol  : class Item
    location: class platypos.services.order.Seat
        private Vector<Item>    _items  = new Vector<Item>();
                       ^
    /home/brandon/Desktop/platypos/services/order/Seat.java:23: cannot find symbol
    symbol  : class Item
    location: class platypos.services.order.Seat
        private Vector<Item>    _items  = new Vector<Item>();
                                                     ^
    3 errors/home/brandon/Desktop/platypos/services/order/Item.java is packaged as follows
    package platypos.services.order;and has been successfully compiled to Item.class in the same directory.
    I am using the latest JDK on Ubuntu 8.04
    I am a bit more skilled in C++ and am trying to learn java, anyone got any clues as to what I am doing wrong?
    Thank you

    yep, here is an abridged version of the Item.java file. and it has been successfully compiled to Item.class
    package platypos.services.order;
    import java.util.Vector;
    class Item
         // Constructor     
         public Item(String name)
              SetName(name);     
        // Main Function
        public static void main(String args[])
    }Edited by: javaperson on Apr 30, 2008 11:01 PM

  • System cannot find file specified during install officejet 6500

    I started my HP solution center software today to do some scanning over my wireless connection.  I received a message box indicating I needed to reinstall the original software that came with my OfficeJet 6500 wireless 709n printer.  when I started the software it recieved the message 'system cannot find file specified'.  No information was given on what file it was looking for.  I then downloaded the software from the HP site (OJ_AIO_6500_E709_Full_Win_WW_140_408.exe) and encountered the same result.  I hookup up my printer via USB and it appeared to go looking for driver updates.  After that the HP solution center software would run but would only connect to my printer if the USB was connected.  Still cannot run the printer software set.
    I recently upgraded my windows 8 64-bit to window 8.1.  It worked before that.  This is not the only software that was broken by the process.  Any help on how I can re-establish my wireless connection to my Officejet 6500 would be appreciated.  
    I also tried the Microsoft 'Fixit' solutions but they are not available for windows 8.1 :-)...

    Hello All,
    Try using the scrubber built into the CD or download.
    From original CD installation:
    1. Insert CD into drive, and then cancel the installer.
    2. Open  "Computer", and then right click on the CD drive and choose open.
    3. Open folder Util
    4. Open folder CCC
    5. Run the L3uninstall.exe (near the bottom of the list).
    6. When the uninstall has completed restart the computer
    7. Download and install the latest version of Adobe flash player
    http://www.adobe.com/support/flashplayer/downloads.html
    8. Restart the computer.
    9. Download and run the HP Printer Install Wizard.
    10. When it comes to the screen asking to accept the terms, don't yet. There will be a few options near the top of the Window. I need you to choose "Connection settings" or "Internet connection usage settings" (It will be something similar to what I just stated). It will give you the options to turn off automatic updates, I will need you to change all of these options to "Off" / "No".
    11. Once they're set to "Off" / "No", continue with the installation like you did before.
    If software was downloaded and extracted to your system:
    1. Type %temp% in the run field
    2. Look for, and open the folder starting with 7z (Example: 7zS2356)
    3. Open folder Util
    4. Open folder CCC
    5. Run the L3uninstall.exe (near the bottom of the list).
    6. When the uninstall has completed restart the computer
    7. Download and install the latest version of Adobe flash player
    http://www.adobe.com/support/flashplayer/downloads.html
    8. Restart the computer.
    9. Download and run the HP Printer Install Wizard.
    10. When it comes to the screen asking to accept the terms, don't yet. There will be a few options near the top of the Window. I need you to choose "Connection settings" or "Internet connection usage settings" (It will be something similar to what I just stated). It will give you the options to turn off automatic updates, I will need you to change all of these options to "Off" / "No".
    11. Once they're set to "Off" / "No", continue with the installation like you did before.
    Also, make sure all of the Windows Updates have been completed.
    Let me know if this works.
    Thank you,
    I worked on behalf of HP.

  • [help] cannot find symbol

    I'm trying to work on lessons from a book called Java Server Faces. Only problem is there seems to be a java file i cannot compile. Maybe someone here can see whats up?
    here is the error i get when i run javac TableData.java
    TableData.java:4: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    private static final Name[] names = new Name[] {
                         ^
    TableData.java:11: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    public Name[] getNames() { return names;}
           ^
    TableData.java:4: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    private static final Name[] names = new Name[] {
                                            ^
    TableData.java:5: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("William", "Dupont"),
        ^
    TableData.java:6: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("Anna", "Keeney"),
        ^
    TableData.java:7: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("Mariko", "Randor"),
        ^
    TableData.java:8: cannot find symbol
    symbol  : class Name
    location: class com.corejsf.TableData
    new Name("John", "Wilson")here is the code
    package com.corejsf;
    public class TableData {
    private static final Name[] names = new Name[] {
    new Name("William", "Dupont"),
    new Name("Anna", "Keeney"),
    new Name("Mariko", "Randor"),
    new Name("John", "Wilson")
    public Name[] getNames() { return names;}
    }I believe i have all my jar files properly located in webapps/xxx/web-inf/lib
    but i could be wrong..
    thanks

    If its a sample application from some place they should have provide it. Otherwise if the Name class usage is simple you can create the class file yourself.
    Subsequently you can create you own jar file for this using the
    jar cvf [jar file name].jar [package folders]\*.class
    and place it in WEB-INF/lib

  • Version XI Cannot Find File USING VBA Shell Command

    I open Adobe Reader from an Access VBA Shell command.  After upgrading to Version 11, the Reader opens but I get the Error Message.  "Cannot Find File".
    This was on a Windows 7 Machine running MS Access 2012.  I had an older PX with XP and Access 2003 on it, so I ran the program on it with Version 10 and the Reader opened with the
    file passed to it using the Shell command.  I updated Adobe Reader to XI on the XP machine and I got the "Cannot Find File" message.  I went back to the Widows 7 machine anbd removed Version 11 and reinstalled Version 10 and the Shell command worked like it did before.  Does anyone know if there is a work a round for the Version 11 error as I have many many customers that may update to Version 11 and my program is not going to work for this particular function.
    Appreciate any help, thanks.

    Q1 Answer
    I use Shell because it has worked for years and it is a build in VBA function and ShellExecute uses Windows API, and I took the easy route.
    As I'm sure you know Shell is for exe, com or bat files and ShellExecute enables
    the opening of files such as txt, pdf... etc by file association.
    Q2 Answer
    The exact string is
    "C:\Program Files (x86)\Adobe\Reader 10.0\Reader\AcroRd32.exe" C:\FoxFales Data\FoxFalesStaff\Alerts\GenericSupplies.pdf
    The path for AcroRd32.exe is retreived by reading the registry entry  "HKEY_CLASSES_ROOT\Software\Adobe\Acrobat\Exe\"
    Q3 Answer
    If you paste the above command in the CMD shell you get the same result.  Reader Opens, but opens with
    the message  "Cannot Find File".
    Newest Results
    In the forum I found threads that indicated that if in Security (Enhanced) you had "Enable Protected Mode At Startup"
    enabled there were some unpleasant results.
    So I turned it off and lo and behold Reader XI with the Shell commandfrom VBA works!
    But as a matter of interest I turned it back on and tried the API call ShellExecute, as you so politely suggested,
    and...IT WORKED with "Enable Protected mode At Startup" enabled.
    I don't understand why Reader XI lets ShellExecute work and not Shell, but I'm happy I  have a solution
    Thanks for you help

  • Spotlight and finder cannot find files as of a certain date. What can be the problem and how to solve?

    Spotlight and search field in Outlook on MacBoon cannot find files as of a certain date. What can be the problem and how to solve?

    Reinstall on both.
    Reinstall Lion, Mountain Lion, or Mavericks without erasing drive
    Boot to the Recovery HD:
    Restart the computer and after the chime press and hold down the COMMAND and R keys until the menu screen appears. Alternatively, restart the computer and after the chime press and hold down the OPTION key until the boot manager screen appears. Select the Recovery HD and click on the downward pointing arrow button.
    Repair
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported then click on the Repair Permissions button. When the process is completed, then quit DU and return to the main menu.
    Reinstall Mountain Lion or Mavericks
    OS X Mavericks- Reinstall OS X
    OS X Mountain Lion- Reinstall OS X
    OS X Lion- Reinstall Mac OS X
         Note: You will need an active Internet connection. I suggest using Ethernet
                     if possible because it isthree times faster than wireless.
    Restore your iPhone to reinstall iOS. Be sure to do this while connected to your computer and iTunes.
         Tap Settings > General > Reset > Erase all content and settings.

  • "cannot find file" after formatting and moving!!

    Wanted to have iTunes library included in Time Capsule backup. So had to reformat external hardrives where all my songs are from Windows do OS. Copied everything on other HD, reformatted HD with OS, copied back all songs. HD still has same name "MUSIC", but iTunes cannot find files.
    Changed in iTunes preferences the location of files to ensure it searches in the right place AND also replaced with text editor in "iTunes Music Library.xml" file all links with new address of HD (now after reformatting to OS I found it to be slightly different despite still same name).
    But iTunes still cannot find the files. Everything is the same as before, HD name, directory structure, file names, etc. ONLY difference is it all is on "OS formatted" drive. Don't want to lose ratings and playlists of over 15,000 songs....is there still a solution?

    The moment I "drag out" the Tunes Library File, then there is nothing left there, and when I open iTunes it is empty.
    That's as expected. That file is the database iTunes uses that keeps track of everything, so when you then launch iTunes, it's starting from scratch.
    I can import the Playlists from the XML and they do appear, but still no songs, all is empty. If I try to reimport from the new location, then they "do not fit into the playlists", meaning ratings etc. are lost.
    Then you apparently didn't get the XML file edited properly; it's not easy to do.
    Why does the simple location function in iTunes Preferences not work?
    It does, when used as designed. The preference is where new additions (imports & purchases) will be stored. It does not change the location for existing files.
    Put the original library file back. Then launch iTunes, Get Info on a representative track, and look at the path to where it thinks the files should be and compare that to the actual path. Any difference at all will break things. If there are differences (drive name slightly different, any difference in folder names/structure, etc.; letter case counts), try correcting them in Finder and see if that gets things working again. If not, then you'll have to use the Add to Library command to get back your tracks which will lose all your ratings, etc.
    Where does iTunes save the links to the original files so it can simply be changed?
    In the iTunes Library file, which cannot be manually edited.

  • Cannot sync photos-says cannot find file, will not sync

    eveytime I try to sync, when it gets to photos, iTunes has an error window with no code that says "Cannot find file, cannot sync" Everthing else backs up and syncs except photos. My husband uses the same mac and he can sync just fine, no errors.

    For iPhoto the link said:
    If you're syncing from an iPhoto or Aperture album, use these steps to find the iPod Photo Cache folder in the default iPhoto Library or Aperture Library location:
    From the Finder, choose Home from the Go menu.
    Once there, open the Pictures folder and locate the iPhoto Library file. (For Aperture, this is called Aperture Library.)  If you have moved your iPhoto Library or Aperture Library to a different location, go to that location in Finder first.
    Control-click the iPhoto Library or Aperture Library file and choose Show Package Contents from the shortcut menu.
    In the next window, locate the iPod Photo Cache folder and drag it to the Trash. Important: Do not remove or modify any other file within the library package. Removing or modifying other files may cause data loss.
    Close the Finder window.
    Are you doing step 3?  You can also right click and select Show Package Contents.  It works both ways for me.  I just tried it.

Maybe you are looking for

  • How to use icon instead of bitmap for image on button in toolbar?

    Hello, I am trying to use an image that has a transparent background on one of the buttons on our custom toolbar in Adobe Acrobat. In the past we have been using the following code with Bitmaps to display the image and it has worked perfectly: ======

  • Dynamic sizing of RAW datatype

    Hi All, I want to read BLOBs out of a table using the DBMS_LOB package I would like to do something like... my_blob_length := DBMS_LOB.GETLENGTH(my_blob); DECLARE my_buffer RAW(my_blob_length); -- this is the bit I'm stuck with ;-) DBMS_LOB.READ(my_b

  • Itunes error message can someone plz help.

    Hello I have uninstalled and then reinstalled itunes multiple times and I keep getting this following message. "The instruction at "0x00ed408c" referenced "0x00ed408c". The memory could not be "written".Click OK to terminate the programnced at " Can

  • Backup Time Machine Once A Day?

    Hello, I'm looking for a Time Machine application that will let me backup once for twice a day instead every hour, any ideas? Thanks for reading my post and your help.

  • Transportation of variants

    what r the std programs to transport transaction variant  and screen variants?