How to install Java 8 via packages.txt?

I tried multiple ways to get java 8 to download via the packages.txt but I keep getting an install error message. I tried multiple attempts changing around a bunch of stuff and nothing is working.

openjdk-8-jdk-headless
openjdk-8-jdk
openjdk8-jdk-headless
openjdk8-jdk
etc…