Created attachment 150438 [details] Diff to /usr/local/etc/rc.d/solr to allow Solr to run using current default Java The Makefile for textproc/apache-solr specifies that it works with Java 1.7+. This version of Solr will run with Java 1.7 or 1.8 but the startup rc.d script "solr" hardcodes procname as /usr/local/openjdk7/bin/java. This means the script won't work properly if, say, OpenJDK 8 is installed. A possible fix for this is to set procname according to the Java VM actually run via /usr/local/bin/java, i.e.: procname=`env JAVAVM_DRYRUN=true /usr/local/bin/java | grep JAVAVM_PROG | cut -f 2 -d =` See attached diff. Cheers, Paul.
Maintainer CC'd
hmmm? Why not just change the line JAVA_VERSION= 1.7+ to JAVA_VERSION= 1.7 ? It appears that the maintainer did not respond to this PR either, and he timed out on an earlier PR. That's 3 consecutive PRs that are timed out, so I'm resetting the port to have no maintainer, right now.
(In reply to John Marino from comment #2) The version of Solr in the port will work with Java 1.7 and Java 1.8. Making the change you suggest will force an installation of Java 1.7 even in the case where the user already has only Java 1.8 installed (which would nevertheless be adequate to run Solr). My suggested change looks at what the default "java" actually is and uses that for the procname. It would be nice to have someone familiar with Java ports comment on the standard way to do this, as I'm not too familiar with the runtime Java selection mechanism. For example, the approach here might be problematic if a system has Java 1.6, 1.7, and 1.8 installed but Java 1.6 set to being the default. Your suggested change is the safest, although it does violate the spirit of the original "JAVA_VERSION= 1.7+" option and forces the installation of Java 1.7.
I prefer the submitted version since it means one less port that needs updating when we switch the default to openjdk8.
A commit references this bug: Author: glewis Date: Sun Feb 15 21:36:30 UTC 2015 New revision: 379050 URL: https://svnweb.freebsd.org/changeset/ports/379050 Log: . Allow Apache Solr to be run with either openjdk7 or openjdk8. PR: 195860 Submitted by: paul@gromit.dlib.vt.edu Changes: head/textproc/apache-solr/files/solr.in
Suggested fix committed with a minor tweak to prevent openjdk6 from ever being used.