Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-16-2007, 03:30 PM
Member
 
Join Date: Aug 2007
Posts: 36
mwildam is on a distinguished road
Saving application settings
I recently looked into the java.util.prefs.Preferences as long as a tutorial mentioned this as a possibility to save application preferences.

Two questions are coming up for me:

1. I am not sure if I should like that java.util.prefs.Preferences - they tell using it under Windows save something to the registry and under Linux to file system. Actually I do not like to save settings to the registry and I want to minimize differences of the behaviour of my application under different operating systems.

How do you store your application settings?


2. In general I can find the user home path using
Code:
System.getProperty("user.home");
This folder can be used to save some user settings using different methods.

But how can I get to some common path (same for all users) - like /etc or <Documents and Settings>\All Users?

Further getting the application path seems to be a little difficult.
Code:
Main.class.getProtectionDomain().getCodeSource().getLocation().getPath()
does not seem to be reliable because it brings different outputs whether I run the application in debugger or if calling it directly from commandline.

Where do you store application specific settings (not user specific settings) - and how do you find out that path?
__________________
Greetings, Martin Wildam.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Graphic settings being overridden? sjchase New To Java 0 01-17-2008 12:27 AM
JVM Heap memory settings nagesh New To Java 1 08-11-2007 11:17 PM
JVm Heap memory settings nagesh Advanced Java 0 08-11-2007 03:49 PM
Detecting Browser Settings arupranjans JavaServer Pages (JSP) and JSTL 0 07-31-2007 03:31 PM
Saving Variables Fish New To Java 6 06-25-2007 09:20 PM


All times are GMT +3. The time now is 09:41 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org