Solved

.properties file creation

Posted on 2011-03-15
6
1,689 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
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 117
Groovy problem when using SOAPUI : DispatchException occurred 7 48
factorial example 4 41
Tomcat: Unable to run tomcat service. 2 20
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

825 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