Results 1 to 3 of 3
  1. #1
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    113
    Rep Power
    0

    Default FileNotFound Exception

    Hello everyone..
    I have a problem with my Project.. i want the same program to run on windows 7 and windows XP
    so i develop my code to create files with specific paths for each OS if i run the program on Windows 7 all are corrent ! but when i try to run
    the program on Windows XP greek Language i have a file not Found exception..

    First ad all i have this method to check the version and set the correct Path :
    Java Code:
    private String windowsVersionCheck(){
    		if(windowsVersion.equals("Windows 7")){
    			PATH = System.getProperty("user.home")+"/Documents/Doctor Assistance/Αρχεία Ασθενών/";
    		}else{
    			PATH = "C:/Documents and Settings/"+System.getProperty("user.name")+"/Τα έγγραφά μου/Doctor Assistance/Αρχεία Ασθενών/";
    		}
    		return PATH;
    	}
    the first one for windows 7 as i say before working fine..
    but the second one on windows xp crash when try to find the folder "Τα έγγραφα μου" (My Documents on greek) and the error i got is this :


    C:\Documents and Settings\Alexandros\+Ώώ?-Ίίώά ίήά?-ά?
    java.io.FileNotFoundException: C:\Documents and Settings\Alexandros\?ά ?ήήά?- Ή
    ΎΫ\Doctor Assistance\Files\PrototypesReportPrototypeAmkaOneS urgery.doc (-ίΊ ί-Ίά
    ώ ϊΫΊάΪ? ύ ίί?ύ ΪΎΫ ΆάϋΎώ?Ή?ΊΎΫ ά?ί-ΎΫ άΏ? ΪΎ ??ΪύΉά)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(Unknown Source)
    at Report.<init>(Report.java:175)
    at Patient.createDoc(Patient.java:167)
    at PatientRegister.registerCheck(PatientRegister.java :495)
    at PatientRegister.actionPerformed(PatientRegister.ja va:659)
    at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Sour
    ce)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(Unknown Sour
    ce)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(Unknown Sour
    ce)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPri vilege(Unknown Sour
    ce)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)


    I am sure that the problem is with greeks and not with my code cause with the path on windows7 my code is working great..

    thx in advance

  2. #2
    ShadowWalker is offline Senior Member
    Join Date
    Mar 2013
    Location
    Greece
    Posts
    113
    Rep Power
    0

    Default Re: FileNotFound Exception

    Crap! i found the mistake.. in one path i got this : PATH2 = "C:/Documents and Settings/"+System.getProperty("user.name")+"/My Documents/Doctor Assistance/Files/Prototypes";
    and i forgot to put to / on the end.. :| close topic pls ;) !! and really sorry..

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,520
    Blog Entries
    7
    Rep Power
    20

    Default Re: FileNotFound Exception

    Consider it done.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. Replies: 5
    Last Post: 05-11-2014, 08:42 PM
  2. unreported exception java.lang.Exception
    By Marisabel in forum New To Java
    Replies: 6
    Last Post: 05-01-2011, 03:21 AM
  3. Replies: 5
    Last Post: 02-14-2011, 11:39 PM
  4. Replies: 1
    Last Post: 02-06-2011, 05:38 AM
  5. Replies: 1
    Last Post: 03-08-2008, 06:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •