On 10/15/16 18:14, Girvin R. Herr wrote:
> On 10/15/2016 12:38 PM, Gary Aitken wrote:
>> On 10/15/16 13:15, Gary Aitken wrote:
>>> After re-installing my os (freebsd 10.3), aoo (4.1.2), mysql
>>> (5.6), and java (openjdk7, 8) when I attempt to open a database I
>>> get the message "No Java installation found..." ok...
>>> The Tools/Options/OpenOffice/Java dialog shows no installed jre. 
>>> I presume this is because they are installed in
>>> /usr/local/openjdkx which is not the standard linux place.
>>> However, when I go to add a JRE, it complains about the folder I
>>> selected not containing a java runtime environment.
>>> Which folder should I be pointing at? I've tried 
>>> /usr/local/openjdk7 /usr/local/openjdk7/jre 
>>> /usr/local/openjdk7/lib /usr/local/openjdk7/bin 
>>> /usr/local/openjdk7-jre /usr/local/openjdk7-jre/bin 
>>> /usr/local/openjdk7-jre/lib
>>> What, specifically, is it looking for to detect a jre? I've tried
>>> installing only the jre port, /usr/local/openjdk7-jre, but
>>> pointing at it doesn't help either.
>> It seemed to work after installing openjdk8-jre
>> But the question remains, what is it looking for to identify a
>> jre? Why doesn't it identify openjdk7-jre as valid?
> Gary, usr/local is a valid place to install programs in *nix.
> However, I have done so and found that some programs expect to be in
> /usr or expect to find programs in /usr, not /usr/local, so beware.
> Do you have a JAVA_HOME environment variable?  If so, what is it
> pointing to? Mine, on Slackware Linux, is pointing to /usr/lib/java .
> By what you say above, I would guess yours should be pointing to
> /usr/local/openjdk7 .  I have reluctantly installed Oracle jdk
> 1.8.0_40, so some locations may be different with openjdk7, but the
> concept should be the same.

I don't have JAVA_HOME set, but do have JAVA_VERSION set (1.7)
That may be an issue at some point, but for this particular problem
I don't think it is (since openjdk8-jre showed up ok).

> My OpenOffice java path is pointing to /usr/lib/java/jre . Normally,
> AOO searches the familiar paths for the java and posts the ones it
> finds in the  Tools -> Options -> OpenOffice -> Java dialog.  If a
> java is selected in that dialog, down at the bottom, it has a
> "Location" where it found it.  I would try the JAVA_HOME first, and
> if that is set properly and AOO still cannot find the java, then
> manually "Add" your java path to the dialog.

The problem is that manually adding a path doesn't work.
I have both openjdk7-jre and openjdk8-jre installed,
as well as the complete jdk7 and jdk8;
in /usr/local/openjdk7-jre and /usr/local/openjdk8-jre and
/usr/local/openjdk7 and /usr/local/openjdk8 respectively.
Aoo automagically found the jre in openjdk8-jre, but not the one
in openjdk7-jre, or the ones in the full openjdkX installs.
If I open the dialog and point it at /usr/local/openjdk7-jre, 
it claims there is no valid jre there.
However, there *is* as nearly as I can tell.  
In particular, /usr/local/openjdk7-jre/lib/rt.jar exists and is
readable.  Same for /usr/local/openjdk7/jre/lib/rt.jar.
Which is why I'm wondering how it determines whether a jre is present
or not.

With only JAVA_VERSION set (to 1.7), compiles and executions seem
to do the right thing:

$ java -version
openjdk version "1.7.0_91"
$ javac garya/ClassTest.java
$ ls -lt garya
total 16
-rw-r--r--  1 garya  1001  246 Oct 15 20:09 Cl.class
-rw-r--r--  1 garya  1001  533 Oct 15 20:09 ClassTest.class
-rwxr-xr-x  1 garya  1001  415 Oct 15 20:07 ClassTest.java
$ java garya.ClassTest

> Another note about java and database connectors.  I use
> mysql-connector-java-5.1.18-bin.jar to connect my AOO to my mariadb
> (mysql) server.  The jar files must be located in a specific place to
> be recognized by java (the jre).  Mine is in
> /usr/lib/java/jre/lib/ext/. , or ${JAVA_HOME}/jre/lib/ext/. .

Already have that one covered, although I'm using 5.1.37
Mine is in /usr/local/openjdkX-jre/lib/ext similar to yours,
although it is actually a symlink to an installed port; the
actual file is in /usr/local/share/java/classes/mysql-connector-java.jar


> HTH. Girvin Herr

To unsubscribe, e-mail: users-unsubscr...@openoffice.apache.org
For additional commands, e-mail: users-h...@openoffice.apache.org

Reply via email to