use following code in java file.
FTValList args = new FTValList();
int errs = ics.GetErrno();
I tried doing it this way but it doesn't work.
How are you calling your java code? If you're not in a servlet context there will not be an ICS object that knows how to dispatch to a JSP engine, and you'll be out of luck.