From adrian at trapletti.org  Tue Apr 16 17:35:36 2013
From: adrian at trapletti.org (Adrian Trapletti)
Date: Tue, 16 Apr 2013 17:35:36 +0200
Subject: [Rd] R package with Java source code
In-Reply-To: <5157CBF3-2CEA-45B9-B63D-77CC841559DC@r-project.org>
References: <516D33F7.9070606@trapletti.org> <516D39B4.5080100@stats.ox.ac.uk>
	<516D58A8.1000000@trapletti.org>
	<5157CBF3-2CEA-45B9-B63D-77CC841559DC@r-project.org>
Message-ID: <516D6FC8.3070703@trapletti.org>


On 04/16/2013 04:42 PM, Simon Urbanek wrote:
> On Apr 16, 2013, at 9:56 AM, Adrian Trapletti wrote:
>
>> I don't really like the approach which ship the redundant jar files unless it is a "precompiled binary" distribution of a package.
>>
> What do you mean by "redundant"?
jars are often not under version control because of their redundancy and 
all the resulting problems.
> Your package won't work without them ...
:-) yes, I know this (> 20 years of experience with Java, slightly less 
with R).

>> In the meantime I found the following suggestion http://romainfrancois.blog.free.fr/index.php?post/2009/03/26/Hello-Java-World which is close to what I was thinking of.
>>
> Well, that's in essence what has been suggested. The point is that *you* have to run build before you publish the package to create the jar file, it can't be done at install time for reasons explained.

My question was not very precise. In fact I wanted to ask about Java 
source code compilation during the build step.

Best regards
Adrian


>
> Cheers,
> Simon
>
>
>> Anyhow thanks for the comments.
>>
>> Best regards
>> Adrian
>>
>> On 04/16/2013 01:44 PM, Prof Brian Ripley wrote:
>>> On 16/04/2013 12:20, Adrian Trapletti wrote:
>>>> Dear All,
>>>>
>>>> Are there any plans around that "R CMD INSTALL
>>>> some_package_containing_java_source code" supports Java source code
>>>> compiling in future versions of R similar to compiling C/C++ and/or
>>>> Fortran sources in the src directory?
>>>>
>>>> Best regards
>>>> Adrian
>>>>
>>> No.  A Java 'compiler' is not required, but if one is available is it is set in etc/Makeconf as JAVAC.
>>>
>>> There are many packages which ship jar files with 'compiled' Java code, and others with .class files.  It is hard to see a case for compiling at install time rather than when preparing the package. But it would be easy to write a suitable rule in src/Makevars.
>>>
>>> Note that most systems will not have a JDK, only a JRE.  That includes Windows systems, but winbuilder should be able to prepare a binary package (it needs a JDK to install rJava, JavaJD ...).
>>>
>>> One needs to be slightly careful with Java version requirements. AFAIR OS X Leopard systems only had 1.5 (at least for one of the architectures) and R 2.15.x still supported Leopard (and packages are still being built for it).  Systems with Java 1.6 aka 6 are still in widespread use, even if it past end-of-life according to Oracle.
>>>
>> -- 
>> Dr. Adrian Trapletti
>> Steinstrasse 9b
>> CH-8610 Uster
>> Switzerland
>>
>> Phone : +41 (0) 44 9945630
>> Mobile : +41 (0) 79 1037131
>>
>> Email : adrian at trapletti.org
>> WWW : www.trapletti.org
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
>>
>>

-- 
Dr. Adrian Trapletti
Steinstrasse 9b
CH-8610 Uster
Switzerland

Phone : +41 (0) 44 9945630
Mobile : +41 (0) 79 1037131

Email : adrian at trapletti.org
WWW : www.trapletti.org



[Rd] R package with Java source code
Adrian Trapletti