The language, the compiler, and the JVM were developed at Sun starting in the early 90s at Sun under the leadership of James Gosling.
Set top boxes were a very early use case. It coincided with the boom of these types of systems that were growing past the traditional “embedded” boundaries. Gosling and the team were working on that when it was still Oak and hadn’t been branded.
There’s an amazing video of him telling the story. I think it’s on YouTube.