I'm Java developer for the last 10 years.
I learned Java 1.5 back in the day. This knowledge is useful. I added some syntax sugar over the years and Java 8 was huge release with lambdas and significant standard library improvements, but old knowledge is relevant.
I learned a lot of J2EE libraries. Enterprise beans, Portlets. Most of this knowledge is obsolete. But servlets and web services are still relevant.
I learned Spring and Hibernate back in the day. Well, Spring evolved a lot, but basics stayed the same, so that knowledge is revelant. Same about Hibernate.
All my JVM internals knowledge is relevant.
I learned Maven back in the day. Recently I switched to Gradle because it seems to be better system, but Maven is not obsolete and I could continue to use it. Though those systems are extremely easy and it's not a huge investment to learn them anyway.
Recently I added Kotlin to my tool set. But this language is heavily based on Java, so all knowledge about Java, JVM and standard libraries is relevant.
So yeah, Java is pretty stable platform and very few things were obsolete. Most of my knowledge is stayed relevant.
JavaScript is crazy world. I have to dive into it once every few years. Everything changing. My old projects don't have a chance to work with new libraries (especially fun with dynamic typing). JavaScript really needs One Big Architect With Beard who will make everything right for everyone to accept.