You have a syntax error on this line:
for(int i=0; i<responseString.length; i++)
It should be:
for(int i=0; i<responseString.length(); i++)
Generally speaking, if you are getting a compiler error, you want to go into the application server logs, in this case since you are using HCP as your application server, you can go into the Java application properties in HCP and there is a log section that you can download the logs from to review. These logs will give you more details around what the actual error is.