Both laptops are debian bulleye release. On the laptop that worked, I downloaded three setup programs into the same directory. I unziped the cubemx, installed it. It left a jre subdirectory in unzip which was used during installation. Later it seems that the jre in the cubemx installation directory is the one which was unzipped in the install source directory.