std::string file = env->GetStringUTFChars(...) instead.

Also, having both Value and value in the same function is pretty terrible.