are the current Long Term Support versions. But is sounds like your problem relates more to dependency management and not so much to Java versioning.
You might want to look into something like Maven or Gradle to manage all direct and indirect dependencies your code has. Those tools can make deployment packages for you that prevent "class not found" situations at runtime. Both tools have plug-ins for NetBeans.
闯ü谤驳别苍