Java Chaîne ReplaceAll méthode donnant illégal de la répétition de l'erreur?

J'ai une chaîne de caractères et lorsque j'essaie d'exécuter le replaceAll méthode, j'obtiens cette erreur étrange:

String str = "something { } , op";
str = str.replaceAll("o", "\n"); //it works fine
str = str.replaceAll("{", "\n"); //does not work

et j'ai une erreur étrange:

Exception in thread "main" java.util.regex.PatternSyntaxException:
Illegal repetition {  

Comment puis-je remplacer les occurrences de "{" ?

InformationsquelleAutor Johnydep | 2011-12-13