Skip to content

Commit

Permalink
Added Java version check.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhahsler committed Jan 7, 2018
1 parent 6ca0fa2 commit c584795
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: arulesNBMiner
Version: 0.1-5.1
Date: 2015-xx-xx
Version: 0.1-6
Date: 2018-01-07
Title: Mining NB-Frequent Itemsets and NB-Precise Rules
Author: Michael Hahsler
Maintainer: Michael Hahsler <mhahsler@lyle.smu.edu>
Expand All @@ -12,7 +12,7 @@ Description: NBMiner is an implementation of the model-based mining algorithm
implemented.
Depends: R (>= 2.10), arules (>= 0.6-6), rJava (>= 0.6-3)
URL: http://lyle.smu.edu/IDA/arules/
BugReports: https://github.com/mhahsler/arulesNBMiner/issues
BugReports: https://github.com/mhahsler/arulesNBMiner
Imports: methods, stats, graphics
SystemRequirements: Java (>= 5.0)
License: GPL-2
15 changes: 12 additions & 3 deletions R/AAAonLoad.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
.onLoad <-
function(libname, pkgname)
rJava::.jpackage(pkgname, lib.loc = libname)
## for rJava

.onLoad <- function(libname, pkgname) {
options(java.parameters="-Xrs") ### so sun java does not kill R on CTRL-C
.jpackage(pkgname, lib.loc = libname)
}

.jinit()
jv <- .jcall("java/lang/System", "S", "getProperty", "java.runtime.version")
if(substr(jv, 1L, 1L) == "1") {
jvn <- as.numeric(paste0(strsplit(jv, "[.]")[[1L]][1:2], collapse = "."))
if(jvn < 1.5) stop("Java 5 or higher is needed for this package but not available")
}
Binary file modified data/Agrawal.rda
Binary file not shown.

0 comments on commit c584795

Please sign in to comment.