How can I restrict my Jar to run only on a specific JDK?

Viewed 29

I'd like to ensure my Java Jar is only ran using a JDK I've provided. I can't find a good way to stop / restrict the program if another JDK is being used to run it.

An idea I have is to hash a file from the JDK and perform a checksum within the Jar. But I'm not sure if this is the best way.

I'm not looking for System.getProperty("java.version") as a solution. Because multiple JDK with the same version exist and it doesn't reveal if the JDK has been altered.

0 Answers
Related