depends on the year the source was made. clean, old v62 sources up to some v83 will be JDK6. then from v83 and onward was JDK7. some sources use JDK8, but not many (or if they do, they don't utilize it thus JDK7 would work just fine).
as for script errors, that's because nashorn no longer uses importPackage (you should clean all these up and remove them anyways), so you'll have to enable it or use jdk6. as for enabling/fixing it, there's a few threads here that explain how - just gotta search for it.