Home » Newcomers » Newcomers » How to use a properties file, internal to the Eclipse project and the jar.
| | |
Re: How to use a properties file, internal to the Eclipse project and the jar. [message #814648 is a reply to message #814621] |
Tue, 06 March 2012 18:06 |
DonCamp Messages: 6 Registered: January 2011 |
Junior Member |
|
|
Equivalent problem, using ResourceBundle:
Any of the following errors occur:
Can't find bundle for base name src.java.resources.ErrorCodes
Can't find bundle for base name java.resources.ErrorCodes
Can't find bundle for base name /java.resources.ErrorCodes
Can't find bundle for base name /src/java/resources/ErrorCodes
, depending on what is used for the path, e.g.
ResourceBundle rb = ResourceBundle.getBundle("java.resources.ErrorCodes")
Per the instructions at the link
http://www.javahotchocolate.com/topics/resbundle.html,
the ErrorCode.properties file has been placed in src/java/resources
(that's what Eclipse generated, after creating the resources package).
On 3/6/2012 12:17 PM, DonCamp wrote:
> Looks detailed enough, thanks Russell.
>
>
> On 3/6/2012 11:47 AM, Russell Bateman wrote:
>> On 3/6/2012 9:17 AM, DonCamp wrote:
>>>
>>>
>>> Hi,
>>>
>>> I can't figure out how to use a Properties file which is inside the
>>> Eclipse project, and which I want to include in the jar.
>>>
>>> The properties file - ErrorCodes.properties - is in the src folder
>>> \Project\src. The main method is in a source file in the
>>> src/java/com.mycompany.err.customcodes folder.
>>>
>>>
>>> [snip]
>>
>> Here's a simple article to get you started:
>>
>> http://www.javahotchocolate.com/topics/resbundle.html
>>
>
|
|
|
Re: How to use a properties file, internal to the Eclipse project and the jar. [message #814649 is a reply to message #814648] |
Tue, 06 March 2012 18:11 |
DonCamp Messages: 6 Registered: January 2011 |
Junior Member |
|
|
Never mind, got it. Had to take the path out completely, using instead:
ResourceBundle rb = ResourceBundle.getBundle("ErrorCodes");
On 3/6/2012 1:06 PM, DonCamp wrote:
> Equivalent problem, using ResourceBundle:
>
>
> Any of the following errors occur:
>
>
> Can't find bundle for base name src.java.resources.ErrorCodes
>
> Can't find bundle for base name java.resources.ErrorCodes
>
> Can't find bundle for base name /java.resources.ErrorCodes
>
> Can't find bundle for base name /src/java/resources/ErrorCodes
>
>
> , depending on what is used for the path, e.g.
>
>
> ResourceBundle rb = ResourceBundle.getBundle("java.resources.ErrorCodes")
>
>
>
> Per the instructions at the link
>
> http://www.javahotchocolate.com/topics/resbundle.html,
>
> the ErrorCode.properties file has been placed in src/java/resources
> (that's what Eclipse generated, after creating the resources package).
>
>
>
>
>
> On 3/6/2012 12:17 PM, DonCamp wrote:
>> Looks detailed enough, thanks Russell.
>>
>>
>> On 3/6/2012 11:47 AM, Russell Bateman wrote:
>>> On 3/6/2012 9:17 AM, DonCamp wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>> I can't figure out how to use a Properties file which is inside the
>>>> Eclipse project, and which I want to include in the jar.
>>>>
>>>> The properties file - ErrorCodes.properties - is in the src folder
>>>> \Project\src. The main method is in a source file in the
>>>> src/java/com.mycompany.err.customcodes folder.
>>>>
>>>>
>>>> [snip]
>>>
>>> Here's a simple article to get you started:
>>>
>>> http://www.javahotchocolate.com/topics/resbundle.html
>>>
>>
>
|
|
|
Goto Forum:
Current Time: Wed Sep 25 17:32:10 GMT 2024
Powered by FUDForum. Page generated in 0.08208 seconds
|