|
From: Clemens K. <cle...@cl...> - 2015-08-28 05:58:45
|
On 2015-08-28 04:19, Barrie Treloar wrote: > On 28 August 2015 at 07:07, Peter Becker <pe...@pe... [2]> > wrote: > >> One note of warning: unless you compile against a corresponding JDK Good point. So at least should compile it against an 1.5 every then and now. >> nothing will stop you from picking up a method that won't be in an >> earlier JDK. The result is a NoSuchMethodException (or something >> like >> that) at runtime. >> >> And there is plenty of innocent looking stuff like this one, which >> was >> introduced in 1.6: >> > > http://docs.oracle.com/javase/7/docs/api/java/lang/String.html#isEmpty() >> [1] >> >> The only safe ways are to compile against the target JDK or to use >> static code analysis tools. Every then and now against a 1.5 JRE is much easier. Could have one in a virtual machine; or, even on main PC, it just needs to be unpacked in some folder, right? So no need to "officially" install with Yum. And, github has a Jenkins, right? So one job there could do the job. Though I would have to push more often, but then, main thing is to ensure it before making a build that the whole wild world will use. thanks, but... > I've not used it but maven animal sniffer plugin will throw > exceptions > in case like this. If somebody is willing to port this to maven - be my guest. I won't do that and struggle with a "dubious" (well at least badly documented) plugin if there are easier ways to achieve things. Besides, what I hear Maven is "obsolete", Cradle is "in" now... No? > The documentation is not great, > http://stackoverflow.com/a/4451057/552958 [3] should give you enough > to get going to enforce this on the minimum jre you want to run on > and > allow some comfort on the jdk you want to build against. > So thank you very much for your advice/suggestions, but I will try one of the above. Probably unpack the JRE to somewhere. All the best, Clemens |