views:

42

answers:

1

Hi,

I have a quite strange issue with Java, I'm getting an error on some machines only, I would like to know if there is any way I can avoid that:

This is the line of code concerned:

JSONTokener jsonTokener = new JSONTokener(
                new InputStreamReader(is, "UTF-8"));

This is the error I get on some machines

The file *.java could not be compiled. Error raised is : The constructor JSONTokener(InputStreamReader) is undefined
+2  A: 

Check the classpath on the machines where this error occurs. This could happen because the library that contains the JSONTokener class is from an older version, where only the JSONTokener(String) is available, and not JSONTokener(Reader).

romaintaz