>> Is Java in decline?
Yes.
Take a look at the graph: https://www.tiobe.com/tiobe-index/java/
Java's original strengths were:
1) "write once, run anywhere": a huge improvement over the platform-dependent C / C++ that was widely used at the time,
2) easier to learn and safe replacement over C++ for many problem domains: finding / growing good C++ talent has always been a challenge
3) large, powerful standard library and massive third-party ecosystem: it made development rapid and much more like building with Legos than rolling your own libraries like many C / C++ shops did
Java's killer use case became backend and middle-tier enterprise software.
Today Java's strengths are less relevant:
1) You can "write once, run anywhere" with containers, Go (easier deployments over Java, lower resource usage compared to Java, easier to learn than Java), or Rust (easier deployments over Java, far lower resource usage compared to Java, harder to learn than Java, more performant than Java).
2) Java never fully displaced C++ for high-performance domains. Go and Rust are solid competitors to both Java and C++ depending on the problem domain.
3) Go and Rust both have wide adoption and third-party ecosystems that compete against Java's ecosystem.
I say this as someone who wrote Java enterprise software for many years. I don't hate Java. It has been very useful and paid my bills for years.
Java is not going away. There is FAR too much software written in Java and enterprises will keep on maintaining legacy software until they choose not to. Java 8 will probably go on for decades as long as someone keeps patching it and selling support. Java will slowly become another COBOL.
>> Was it caused by all that Oracle bullshit in recent years?
Partially.
Breaking changes in how the JDK / JRE worked between Java 8 and Java 9 were a contributing factor.
Oracle's licensing changes caused many enterprises to flee to alternative OpenJDK distributions, effectively causing some mindset fragmentation and encouraged enterprises and developers to look at alternatives.