From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco van Zwetselaar Subject: Re: Should java .jar-filenames include the version? Date: Mon, 12 Sep 2016 12:08:09 +0300 Message-ID: <7382246c-1e13-83f1-8b83-db703efc1da8@zwets.com> References: <87vay5s4f5.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39003) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjNFE-0007td-MS for guix-devel@gnu.org; Mon, 12 Sep 2016 05:09:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bjNFB-00088v-EZ for guix-devel@gnu.org; Mon, 12 Sep 2016 05:09:40 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:33253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bjNFB-00080O-7c for guix-devel@gnu.org; Mon, 12 Sep 2016 05:09:37 -0400 Received: by mail-wm0-f42.google.com with SMTP id b187so6796397wme.0 for ; Mon, 12 Sep 2016 02:09:15 -0700 (PDT) Received: from [192.168.42.34] ([197.152.56.14]) by smtp.gmail.com with ESMTPSA id m133sm16870941wmg.0.2016.09.12.02.08.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 02:08:14 -0700 (PDT) In-Reply-To: <87vay5s4f5.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org On 09/09/16 14:23, Alex Vong wrote: > I prefer including the version. Consider the following > situation. Package foo has version A and B, both installing to path > ~/.guix-profile/share/java/ (symlink to store). When the user installs > both version A and B, there will be a conflict. Please note that I do > not know java very well. Will those jar files be installed to different > locations instead of ~/.guix-profile/share/java/ if we switch to maven > later? No. Jar-files can be placed anywhere and get resolved through the application's classpath at runtime. The default classpath contains only the jar files which come with the platform (i.e. are part of the language version & standard library). The classpath for an application has no default value; it is set through environment variable CLASSPATH a/o arguments to the JVM. The application classpath can include directories (bad idea) and names of jar or zip files (better idea, especially if they have version numbers). To entirely eliminate dependency issues, many applications resort to packaging all dependency jars with the application and point the classpath to "inside the application". > By the way, does java / maven has something similar to so name for abi > compatibility? Core Java doesn't at the library (jar) level[*], though proposals have been made since at least version 1.4 to add it to the platform. The OSGI model which underlies e.g. the Eclipse platform is an "in Java" solution which got very close, and semantically went way beyond soname. There was talk of adding that to version 8 but IIRC it didn't make it. Cheers, Marco [*] Needs qualification: I was hard core Javan up to version 6. I'm extrapolating what for ages seemed to go nowhere to versions 7..9. > Hartmut Goebel writes: > >> Hi, >> >> as I'm going to release patches for some java packages, I'd like to >> get consent on one point: >> >> Should java .jar-filenames include the version? >> >> This only effects those .jar for which there is no build.xml (or >> equivalent) is present and thus #:jar-file is to be specified. >> >> The jar-files currently packaged do not include the version, but most . >> jar-files build using a build.xml or maven .pom seam to include it. >> OTOH, the version is already in the prefix, thus it is redundant. >> >> What do you think? >> >> (I personally do not care much, I just want to avoid duplicate work.)