some background:
I recently started using Ubuntu, which I heard to use for programming. I'm also making a game that uses directories such as C:\Program Files\Folder\properties.properties
which, as you can see, was designed for windows because i just barely transfered. what i want to do is keep coding for windows, because that is currently my designated audience, but do it on ubuntu.
so here is my question:
- can i make the directory path (ie.
C:\program files\folder\properties.properties
) cross platform. so if the os is Ubuntu, it goes/FolderName/properties.properties
or whatever, and if it's windows it goes the way i have shown above, and if mac, it does whatever mac does. - if not, is there a way to direct java to
C:\program files\folder\properties.properties
without actually changing the path. because right now, C: isnt recognized because that isnt how linux works.
Any help would be great! thanks a ton in advance!
EDIT: based on the first answer by @Ron Dahlgren, please answer this:
the directory to my running .jar is C:\Program Files\Folder\Files\bin\main.jar
and the path to my .properties is C:\Program Files\Folder\Files\User\properties.properties
. so i understand how the / works, but how would i make it go up a folder, and access the properties. how does it access the properties file? thanks!