1. You can safely use the latest android.jar during compilation. It is set under Tools - Configure Paths. It has nothing to do with targetSdkVersion.
2. I wouldn't set the targetSdkVersion to 27 for now. This post explains the meaning of targetSdkVersion: https://www.b4x.com/android/forum/threads/min-target-sdk-version.84562/#post-535711