Solved

.properties file creation

Posted on 2011-03-15
6
1,773 Views
Last Modified: 2012-06-21
Please advice how to create .properties file in JDeveloper.
In NetBeans it's option in New, but in jdev I can't find where is it.
0
Comment
Question by:gbcbr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 86

Assisted Solution

by:CEHJ
CEHJ earned 50 total points
ID: 35140910
A properties file is just a text file, so if there's no special option, it probably won't matter
0
 

Author Comment

by:gbcbr
ID: 35140960
I know this, I just want to create it by IDE, so it will place properly and make visible. Otherwise I have to know in which directory to put it.
I have bad experience with image files, I put them as I understood properly, inside of src directory, but they invisible for IDE.
Maybe it track them in some way.
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 35141019
as per i know in jdevelpoer only xml file have not property file
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

Author Comment

by:gbcbr
ID: 35141031
This what I'm found only.
So, in which directory to place externally created file?
0
 
LVL 92

Accepted Solution

by:
objects earned 100 total points
ID: 35142715
depends on how you are loading it. If you are loading it using the classloader then you need to put it in a directory that is in the classpath
If you're loading it directly as a file then you can put it anywhere

I'd suggest creating a directory named say 'resource' and put it in there.
If you want to load then with the classloader then also add that folder to your classpath


0
 
LVL 2

Assisted Solution

by:calboronster
calboronster earned 100 total points
ID: 35146393
One of the better and fail-safe ways to manage and control the external file location is
to mention a JVM runtime system parameter (for example user.home). And use this property in your application code (through System.getProperty) to retrieve the absolute path of the file. I use this to retrieve the .properties files in my application.

1. In JVM properties define as :
Java .. -Duser.home=/etc/properties/abc.properties ...

2. In file read location as
String userhome = System.getProperty("user.home");

The basic advantage of this method is that this makes your application and its properties as container independent and easily manageable.
Secondly, the testing of properties requires you to simply alter the value of the property.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
The viewer will learn how to implement Singleton Design Pattern in Java.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question