Hi Nicolai, On Tue, Oct 20, 2015 at 9:56 AM, Nicolai Parlog <n...@codefx.org> wrote:
> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > Hi Eric. > > > Why not use OSGi? Or is that what you mean by a "container"? > I assume that the quote I gave uses "container" to mean systems like > OSGi (it's from Alan, maybe he will correct me if I'm wrong). So yes, > I mean that. > I am trying to find a way without OSGi because it looks like it is not > used for many projects (relatively speaking). But most projects > routinely run into problems with conflicting versions and it would be > great if Jigsaw could solve this for them out of the box. > OSGi is used for far more projects than Jigsaw is! I think you're far, far better off if you can avoid this problem. Even with OSGi, which is fully capable of supporting many different versions of a JAR file, to get it right requires some skill at designing for that type of modularity. You're unlikely to take any off-the-shelf library and get multiple versions loaded into a JVM successfully. Java is *very* leaky with interfaces crossing ostensible package boundaries. As I understand it, since what you're asking for is specifically out of scope, I don't think you're going to get a great answer here. Eric. > > so long ... Nicolai > > > > On 20.10.2015 18:10, Eric Johnson wrote: > > Why not use OSGi? Or is that what you mean by a "container"? > > > > Eric. > > > > On Tue, Oct 20, 2015 at 6:30 AM, Nicolai Parlog <n...@codefx.org> > > wrote: > > > > Hi! > > > > There have been a number of threads regarding loading multiple > > versions of the same module. The requirements say: > > > > "It is not necessary to support more than one version of a module > > within a single configuration."[1] > > > > The threads hence usually end like this: > > > > "The module system isn't suggesting any solutions, it is instead > > leaving this problem to the build tools and containers."[2] > > > > I can see how we can use class loaders (and now layers) to load > > multiple versions at runtime. This is essentially what containers > > do. > > > > Now I wonder, is there anything a build tool (or a dedicated > > developer for that matter) can do to launch the JVM with multiple > > versions of the same module? > > > > Running Example: > > > > App requires LibA App requires LibB version 2 LibA requires LibB > > version 1 > > > > One way I hoped to do this was to treat both versions as two > > different modules, i.e. renaming them and update the dependencies > > on them. > > > > App requires LibA App requires LibB_v2 LibA requires LibB_v1 > > > > This does not work because both modules would export the same > > packages. That's a little disappointing - I hoped it wouldn't > > matter because no module is reading from both versions. > > > > Since this failed I see no way to solve this aspect of JAR hell > > without containers. Does anybody else seen one? > > > > so long ... Nicolai > > > > > > [1] > > http://openjdk.java.net/projects/jigsaw/spec/reqs/#multiple-versions > > > > > [2] > > http://mail.openjdk.java.net/pipermail/jigsaw-dev/2015-October/004787. > ht > > > > > ml > > > > > > > >> > >> > > > > - -- > > PGP Key: > http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509 > > Web: > http://codefx.org > a blog about software development > http://do-foss.de > Free and Open Source Software for the City of Dortmund > > Twitter: > https://twitter.com/nipafx > > Diaspora: > n...@pod.geraspora.de > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v2 > > iQIcBAEBCAAGBQJWJnIhAAoJEMo7rS6czNUJkVkQAKsoySvjZGpWXo5P7hM9ePpf > N0iawy47qMEgeMYrgephHL/1mLyhfV7ISHDLjTCdNuLsUz1h26o4fQXy8gWfd192 > mN+q3iDQcXX9ub0NQQu8zh5GHd/8Y6Woi1dqPTaFNvRHEBFsAj7amnb0KkLO2uZz > KGX0gIRlOfzOC/atHWgusx2MBUoH4syDOSwhijNm0DiYLsxSDOAkJWZGsiwGrpK+ > 7cSE7mL5TOX2e6DI8dcW/nRMxUM5Zn5em5gi8dYc4LwfYlfjQ2Dz02QymJnOKqG7 > UdBrb+od24vepK6Re/a95yVDmpqDhwsF/4CZF+lzxZwtJhnJ9yQrPGKjPsDYs4Yq > T8zt/d9O0866zxzo00dM//wx57wPY0VEYdh0XfwveqmJTBYPFrKGqRzN6jUs8cMa > pdKAyq5iJ61A2jpI7KJ4Bk5Xo7OMxCT4uCVu6S1rTKym0lP7oNn1xiFMxtjgEuOE > fNFWQEYEM1iCVcmJ7PH25O9/C5sjsgzFwy/d2tWfKdDlyf5WVRVIHOYvjKrr+yBL > fDlueRRrvaxJhJOYHRJ1xRvmXDNVmFlbzxrnOQcK/nU7R8IwELwr6FfSteOl7WEt > 1qY6f0DuvIzhCg6GWt+Jm4wdeqDpYnmSpuDYDGtbMiFOfhJ0fCnqJwN3lR70FPNa > dopyg43RJIJXUXHm0+S0 > =s6OU > -----END PGP SIGNATURE----- > >