[Rd] Canonical package directory name for JAR files?

Simon Urbanek simon.urbanek at r-project.org
Thu Feb 9 02:08:45 CET 2012

On Feb 8, 2012, at 5:31 PM, Roebuck,Paul L wrote:

> What would be involved in modifying rJava's .jpackage() method
> to search in both locations ('java' and/or 'jars') for JAR files
> to be added to the CLASSPATH on JVM initialization?

Well, it wouldn't take much but I don't like that idea. The canonical directory as far as rJava is concerned is java. 
As I said, I think S+ behavior is irrelevant for R here since it is a different philosophy (and our package system has nothing to do with S+) - their API is not even compatible to ours so it's not our fault. In addition, I think it is a bad idea to mix up the directories as S+ does.


> On 2/8/12 4:12 PM, "William Dunlap" <wdunlap at tibco.com> wrote:
>> We don't "mandate" a given JDK (including the compiler,
>> javac), but we do supply the JRE.  We do require that the
>> java compiler be able to produce code that the JRE accepts
>> (we test-run javac with a variety of common version-type
>> flags to try to find one that works with our JRE).
>> It is source:pkg/java/{src,prebuiltjars,Makevars} -> binary:pkg/jars,
>> roughly parallel with source:pkg/src -> binary:pkg/libs.
>> Bill Dunlap
>> Spotfire, TIBCO Software
>> wdunlap tibco.com
>>> -----Original Message-----
>>> From: Simon Urbanek [mailto:simon.urbanek at r-project.org]
>>> Sent: Wednesday, February 08, 2012 1:46 PM
>>> To: William Dunlap
>>> Cc: Roebuck,Paul L; R-Devel
>>> Subject: Re: [Rd] Canonical package directory name for JAR files?
>>> Unfortunately we cannot mandate JDK so packages have to use the build
>>> stage for compilation so the S+ model doesn't work. I think java is
>>> more consistent than src/java -> jars
>>> Sent from my iPhone
>>> On Feb 8, 2012, at 3:27 PM, William Dunlap <wdunlap at tibco.com> wrote:
>>>> For what it is worth, the S+ package system uses
>>>> the java directory in source packages to store
>>>> java source code (under pkg/java/src/, using the usual
>>>> directory structure that follows the class structure
>>>> under there), prebuilt jar files (in pkg/java/prebuiltjars,
>>>> no subdirectories), and a Makevars file (pkg/java/Makevars)
>>>> that can define the java compiler flags PKG_JAVAC_CLASSPATH
>>>> and PKG_JAVACFLAGS, e.g.,
>>>> PKG_JAVAC_CLASSPATH=$(SHOME)/java/jre/libext/jaxp.jar;$(SHOME)/java/jre/libe
>>>> xt/batik.jar
>>>> PKG_JAVACFLAGS=-verbose -g
>>>> INSTALL compiles the java code in pkg/java/src and puts
>>>> it into into a jar file called pkg/jars/pkg.jar.  All of
>>>> the jar files in pkg/java/prebuiltjars are copied into
>>>> pkg/jars as well.  The installed package has a jars directory
>>>> but no java directory (i.e., {java,jars} <=> {src,libs}).
>>>> library(pkg) adds pkg/jars to the CLASSPATH so .Java calls
>>>> will find it.
>>>> Bill Dunlap
>>>> Spotfire, TIBCO Software
>>>> wdunlap tibco.com
>>>>> -----Original Message-----
>>>>> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-project.org]
>>>>> On Behalf Of
>>> Roebuck,Paul L
>>>>> Sent: Wednesday, February 08, 2012 8:14 AM
>>>>> To: Simon Urbanek
>>>>> Cc: R-Devel
>>>>> Subject: Re: [Rd] Canonical package directory name for JAR files?
>>>>> On 2/7/12 5:37 PM, "Simon Urbanek" <simon.urbanek at r-project.org> wrote:
>>>>>> On Feb 7, 2012, at 4:34 PM, Roebuck,Paul L wrote:
>>>>>>> We have an R package which needs to include a JAR file.
>>>>>>> Is there a canonical directory for it?
>>>>>> rJava defines "java" for that purpose (see ?.jpackage).
>>>>>> How canonical that is may be open for debate ;)
>>>>> Yeah, when I wrote Java stuff, that was the Java source code
>>>>> root directory. Yet, 'lib' (which was the directory where JAR
>>>>> files lived in Java projects) seems inappropriate for non-Java
>>>>> projects.
>>>>> But 'java' appears to be the de-facto standard for R packages,
>>>>> so...
>>>>> ______________________________________________
>>>>> R-devel at r-project.org mailing list
>>>>> https://stat.ethz.ch/mailman/listinfo/r-devel

More information about the R-devel mailing list