Welcome to the most active Linux Forum on the web.
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: 458

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: Solaris 11.4, Oracle Linux, Mint, Ubuntu/WSL
Posts: 9,784

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
/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: 458

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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:07 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
Open Source Consulting | Domain Registration