[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Help needed for calling Java class from R



On Tue, Apr 14, 2020 at 06:52:56PM +0200, Florian Weimer wrote:
> * Andreas Tille:
> > ERROR: loading failed
> > * removing '/build/r-cran-rcdk-3.5.0/debian/r-cran-rcdk/usr/lib/R/site-library/rcdk'
> > dh_auto_install: error: R CMD INSTALL -l /build/r-cran-rcdk-3.5.0/debian/r-cran-rcdk/usr/lib/R/site-library --clean . "--built-timestamp='Mon, 23 Mar 2020 21:27:30 +0100'" returned exit code 1
> > make: *** [debian/rules:4: binary] Error 25
> > dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
> > I: copying local configuration
> > E: Failed autobuilding of package
> >
> >
> > I verified in the pbuilder chroot that the missing class exists in CLASSPATH:
> >
> > root:/# grep NitrogenRule /usr/share/java/*
> > Binary file /usr/share/java/cdk-formula-2.3.jar matches
> > Binary file /usr/share/java/cdk-formula.jar matches
> 
> Please check if /usr/share/java/cdk-interfaces.jar is on the
> classpath.  The missing class is
> org.openscience.cdk.exception.CDKException (apparently a
> superinterface of org.openscience.cdk.formula.rules.NitrogenRule), and
> it's contained in that JAR file.

This is a good hint.  So I tried:


$ git diff
diff --git a/debian/rules b/debian/rules
index 529c38a..bde1d1b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,6 @@
 #!/usr/bin/make -f
 
+export CLASSPATH=/usr/share/java/cdk-interfaces.jar:/usr/share/java/cdk-silent.jar
+
 %:
        dh $@ --buildsystem R


and while the first error vanished that way I get the next one:


*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for 'rcdk':
 .onLoad failed in loadNamespace() for 'rcdk', details:
  call: .jcall("org/openscience/cdk/silent/SilentChemObjectBuilder", 
  error: RcallMethod: cannot determine object class
Error: loading failed
Execution halted
ERROR: loading failed
* removing '/build/r-cran-rcdk-3.5.0/debian/r-cran-rcdk/usr/lib/R/site-library/rcdk'
dh_auto_install: error: R CMD INSTALL -l /build/r-cran-rcdk-3.5.0/debian/r-cran-rcdk/usr/lib/R/site-library --clean . "--built-timestamp='Mon, 23 Mar 2020 21:27:30 +0100'" returned exit code 1
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2


root:/# grep SilentChemObjectBuilder /usr/share/java/*
Binary file /usr/share/java/cdk-silent-2.3.jar matches
Binary file /usr/share/java/cdk-silent.jar matches

Seems I did not really understood the trick to set CLASSPATH. :-(

Kind regards and thanks so far

      Andreas.

-- 
http://fam-tille.de


Reply to: