I am working on a big project at my firm where I have encountered a strange error while working with replace method for String.

Here is the Scenario:

I am taking values from properties file using a singleton class that retrieves these properties. I have a String of DATA which includes two replacement keys which are supposed to be replaced with values generated programatically.

For example:

```
String strDetails = PropertyLoader.get("details");
String strDataKey1= PropertyLoader.get("datakey1");
String strDataKey2 = PropertyLoader.get("datakey2");

strDetails = strDetails.replace(strDataKey1, "Programmatically Generated Value 1");

strDetails = strDetails.replace(strDataKey2, "Programmatically Generated Value 2");

```

in the above code replacement of `strDataKey1` is working but `strDataKey2` isn't. 

I created simple Java program to test this and it worked in the same way I tried debugging the code in the above two lines all values are coming as expected, but the result of replacement fails for `strDataKey2`.

Note - Both `strKey1` and `strKey2` have special character `'$'`.
Please advise if anyone knows how to fix it. I am using Eclipse latest version for JavaEE I cannot use other IDEs at my firm.