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 do you know what version number to use?

I’ve recently heard a pithier versioning strategy, that I first encountered at Eric Elliot’s Medium account. It’s more weighted towards library versioning that customer facing version numbers, but it has the advantage of simplicity. Use a three part version number, where each number means: breaking.feature.fix breaking: Something has changed that means code/expectations must change feature: … 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