Visit the LQ Articles and Editorials section
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-26-2004, 05:44 PM   #1
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 450

Rep: Reputation: 30
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?

Old 10-26-2004, 06:15 PM   #2
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris10, Solaris 11, Mint, OL
Posts: 9,570

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
/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.
Old 10-26-2004, 08:01 PM   #3
Registered: Jun 2004
Location: PA
Distribution: Fedora (latest git kernel)
Posts: 450

Original Poster
Rep: Reputation: 30
yes i'm running windows for this current project.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash: ln and relative paths tortle Programming 8 05-10-2010 05:50 AM
Absolute and relative paths Gins Linux - General 6 11-08-2008 08:48 PM
Symbolic Links, directories, and relative paths (../). Can it be done? jimwillsher Linux - Newbie 1 03-11-2005 05:27 PM
locating and edition .profile for java paths Madaize Linux - Newbie 1 11-06-2004 11:41 PM
program that generates relative paths? TheMaXX Linux - Software 1 10-21-2003 02:17 PM

All times are GMT -5. The time now is 04:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration