How to check JRE version prior to launch?

You could do this using reflection and two compilers. Compile a main class with the oldest java version you want to be able to run at all with. It checks the version using System.getProperty(“java.version”), or whatever, and then uses reflection to load your real main class if that check passes, possibly even loading the jar … Read more

Java API to find out the JDK version a class file is compiled for?

import java.io.*; public class ClassVersionChecker { public static void main(String[] args) throws IOException { for (int i = 0; i < args.length; i++) checkClassVersion(args[i]); } private static void checkClassVersion(String filename) throws IOException { DataInputStream in = new DataInputStream (new FileInputStream(filename)); int magic = in.readInt(); if(magic != 0xcafebabe) { System.out.println(filename + ” is not a valid … Read more

How to do version numbers? [closed]

[major].[minor].[release].[build] major: Really a marketing decision. Are you ready to call the version 1.0? Does the company consider this a major version for which customers might have to pay more, or is it an update of the current major version which may be free? Less of an R&D decision and more a product decision. minor: … Read more