LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   relative/absolute paths in Java (https://www.linuxquestions.org/questions/programming-9/relative-absolute-paths-in-java-247651/)

djgerbavore 10-26-2004 05:44 PM

relative/absolute paths in Java
 
i have a program that reads in images; however, I'm having trouble displaying hte images using relative paths. My computer at home with java 1.5.0, the "/file\\image.gif" the path works fine, but when i'm compiling and runing on another machine i can't see the pictures, using relative path, it only works for absolute. the java at other computers are all 1.4.2_05. Is there something i'm doing wrong? or is this a bug in java?

thanks,
djgerbavore

jlliagre 10-26-2004 06:15 PM

/file\\image.gif is not a relative path, path\\image.gif or path/image.gif are, depending on the platform. Are you running on windows ?
See the path.separator system property.

djgerbavore 10-26-2004 08:01 PM

yes i'm running windows for this current project.


thanks


All times are GMT -5. The time now is 01:29 PM.