New install, Java setup

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

New install, Java setup

Brenden Towey
Hi folks,

I just installed a new copy of Octave.  During the installation process,
it said it couldn't find the JRE on my system.  I have one, so I'd like
to configure Octave now for Java (it's did install successfully).  How
can I do this?

Any help is much appreciated!

Brenden




Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

PhilipNienhuis
Brenden Towey wrote
> Hi folks,
>
> I just installed a new copy of Octave.  During the installation process,
> it said it couldn't find the JRE on my system.  I have one, so I'd like
> to configure Octave now for Java (it's did install successfully).  How
> can I do this?
>
> Any help is much appreciated!

A first step would be to tell us what operating system you use. Windows?
Linux? OSX?
Second step is telling which Octave release you installed.
A third might be to tell if you have a 32-bit or 64-bit Java JRE and a
32-bit or 64-bit Octave (they should match).

Philip



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

Andrew Janke-2


On 10/2/19 1:20 PM, PhilipNienhuis wrote:

> Brenden Towey wrote
>> Hi folks,
>>
>> I just installed a new copy of Octave.  During the installation process,
>> it said it couldn't find the JRE on my system.  I have one, so I'd like
>> to configure Octave now for Java (it's did install successfully).  How
>> can I do this?
>>
>> Any help is much appreciated!
>
> A first step would be to tell us what operating system you use. Windows?
> Linux? OSX?
> Second step is telling which Octave release you installed.
> A third might be to tell if you have a 32-bit or 64-bit Java JRE and a
> 32-bit or 64-bit Octave (they should match).
>
> Philip
>
>
>
> --
> Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
>
>

Also note that last I checked, on macOS (and I think Linux), Octave gets
built against a specific version of the JVM, so you need to have that
exact JVM release installed (the exact "uXXX" number) or it won't be
found. If you installed a pre-built Octave, you'll need to find out
which JVM version it was built against.

Cheers,
Andrew


Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

Brenden Towey
Thanks for the reply.  I should have figure out some of that info on my
own but I wouldn't have thought to include all of it.

OS: Windows 10
GNU Octave: version 5.1.0, configure for "x86_64-w64-mingw32"
Java: I have both JDK 1.8.0 u 131, and JDK 11.0.1 installed.  Both are
64 bit versions.


On 10/2/2019 10:55 AM, Andrew Janke wrote:

>
> On 10/2/19 1:20 PM, PhilipNienhuis wrote:
>> Brenden Towey wrote
>>> Hi folks,
>>>
>>> I just installed a new copy of Octave.  During the installation process,
>>> it said it couldn't find the JRE on my system.  I have one, so I'd like
>>> to configure Octave now for Java (it's did install successfully).  How
>>> can I do this?
>>>
>>> Any help is much appreciated!
>> A first step would be to tell us what operating system you use. Windows?
>> Linux? OSX?
>> Second step is telling which Octave release you installed.
>> A third might be to tell if you have a 32-bit or 64-bit Java JRE and a
>> 32-bit or 64-bit Octave (they should match).
>>
>> Philip
>>
>>
>> Also note that last I checked, on macOS (and I think Linux), Octave gets
>> built against a specific version of the JVM, so you need to have that
>> exact JVM release installed (the exact "uXXX" number) or it won't be
>> found. If you installed a pre-built Octave, you'll need to find out
>> which JVM version it was built against.
>>
>> Cheers,
>> Andrew
>>
>>



Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

PhilipNienhuis
Brenden,

Please answer below the mail, not on top (= no "top posting")


Brenden Towey wrote

> On 10/2/2019 10:55 AM, Andrew Janke wrote:
>>
>> On 10/2/19 1:20 PM, PhilipNienhuis wrote:
>>> Brenden Towey wrote
>>>> Hi folks,
>>>>
>>>> I just installed a new copy of Octave.  During the installation
>>>> process,
>>>> it said it couldn't find the JRE on my system.  I have one, so I'd like
>>>> to configure Octave now for Java (it's did install successfully).  How
>>>> can I do this?
>>>>
>>>> Any help is much appreciated!
>>> A first step would be to tell us what operating system you use. Windows?
>>> Linux? OSX?
>>> Second step is telling which Octave release you installed.
>>> A third might be to tell if you have a 32-bit or 64-bit Java JRE and a
>>> 32-bit or 64-bit Octave (they should match).
>
> Thanks for the reply.  I should have figure out some of that info on my
> own but I wouldn't have thought to include all of it.
>
> OS: Windows 10
> GNU Octave: version 5.1.0, configure for "x86_64-w64-mingw32"
> Java: I have both JDK 1.8.0 u 131, and JDK 11.0.1 installed.  Both are
> 64 bit versions.

OK, next step:
What do he following commands say?

__octave_config_info__.build_features.JAVA

system ("java --version")

javaObject ("java.lang.Double", 5.3)

Philip



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

Brenden Towey
On 10/3/2019 7:09 AM, PhilipNienhuis wrote:

> Brenden,
>
> Please answer below the mail, not on top (= no "top posting")
>
> OK, next step:
> What do he following commands say?
>
> __octave_config_info__.build_features.JAVA
>
> system ("java --version")
>
> javaObject ("java.lang.Double", 5.3)

Thanks Philip, I appreciate you sticking with this.  The first two give
an answer and the last just errors out.

 >> __octave_config_info__.build_features.JAVA
ans = 1
 >> system("java -version")
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
ans = 0
 >> javaObject ("java.lang.Double", 5.3)
error: javaObject: could not find library or dependencies: C:\Program
Files\Java\jdk1.8.0_131/jvm.dll
 >>

I can manually verify that there's no "jvm.dll" in the JRE/bin
subdirectory.  There is a "java.dll" however, maybe recent releases have
switched names?  Also the path that Octave uses seems messed up, there
should be a "/bin" at the end.

(So no top posting on this list?  That's different from most other lists
I'm on.  What about trimming quoted messages?  I personally don't need
to see every single message quoted in-line in an email.)





Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

Brenden Towey
In reply to this post by PhilipNienhuis
On 10/3/2019 7:09 AM, PhilipNienhuis wrote:
OK, next step:
What do he following commands say?

__octave_config_info__.build_features.JAVA

system ("java --version")

javaObject ("java.lang.Double", 5.3)

Philip



I found this on a StackOverflow question:

"If you intend to use the Invocation API in a native application and access Java APIs installed as part of OpenJDK (Java 10, Java 11, etc.) in ${JAVA_HOME} directory, link against (or dynamically load) jvm.dll found in ${JAVA_HOME}/bin/server/jvm.dll."

So it looks like Octave is expecting something found in the /bin/server directory.  The error message I mentioned above is either off, or the path it uses didn't get set up properly.  I do have a "jvm.dll" in the /server directory.

Link to SO:
https://stackoverflow.com/questions/29486755/what-is-the-path-of-the-jvm-inside-the-jre



Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

PhilipNienhuis
In reply to this post by Brenden Towey
Brenden Towey wrote

> On 10/3/2019 7:09 AM, PhilipNienhuis wrote:
>> Brenden,
> <snip>
>> OK, next step:
>> What do he following commands say?
>>
>> __octave_config_info__.build_features.JAVA
>>
>> system ("java --version")
>>
>> javaObject ("java.lang.Double", 5.3)
>
> Thanks Philip, I appreciate you sticking with this.  The first two give
> an answer and the last just errors out.
>
>  >> __octave_config_info__.build_features.JAVA
> ans = 1

So Octave was built with Java support.


>  >> system("java -version")
> java version "1.8.0_131"
> Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
> Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
> ans = 0

So Java works and it is a 64 bit Java.
Question then is, is octave itself 64-bit...

If you start up Octave you'll see some messages, esp. something like:

=======================================================
GNU Octave Version: 5.1.0 (hg id: d05d6eebde10)
GNU Octave License: GNU General Public License
Operating System: MINGW32_NT-6.1 Windows 7 Service Pack 1 x86_64
=======================================================

So what Octave mention here, also x64-86? or

What does  "ver" in the terminal say?

And what does the Octave command

__octave_config_info__.build_environment.CC

tell you?


>  >> javaObject ("java.lang.Double", 5.3)
> error: javaObject: could not find library or dependencies: C:\Program
> Files\Java\jdk1.8.0_131/jvm.dll
>  >>
>
> I can manually verify that there's no "jvm.dll" in the JRE/bin
> subdirectory.  There is a "java.dll" however, maybe recent releases have
> switched names?  Also the path that Octave uses seems messed up, there
> should be a "/bin" at the end.

Yeah Octave looks in the wrong place.
E.g. on my Windows 7 system I have the jvm.dll in
C:\Program Files\Java\jre-10.0.2\bin\server\
(64-bit Java)

Do you have a JAVA_HOME setting in your environment? (that could screw up
things.)
What does the Octave command

getenv ("JAVA_HOME")

return?


> (So no top posting on this list?  That's different from most other lists
> I'm on.  What about trimming quoted messages?  I personally don't need
> to see every single message quoted in-line in an email.)

It's the habit ("netiquette") here and on many many other mailing lists.
Just adapt to it, people expect it.
Also on Stackoverflow you'll see answers below the question, isn't it?
MS-Outlook was the mailing program that spoiled many unwary users into top
posting and at my work (an almost purely Windows-only environment) I also
top-post (usually) as my colleagues expect it.

I just adapt to the local habits.

Trimming is OK.

Philip




--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

Brenden Towey


On 10/6/2019 12:05 PM, PhilipNienhuis wrote:
> If you start up Octave you'll see some messages, esp. something like:
>
> =======================================================
> GNU Octave Version: 5.1.0 (hg id: d05d6eebde10)
> GNU Octave License: GNU General Public License
> Operating System: MINGW32_NT-6.1 Windows 7 Service Pack 1 x86_64
> =======================================================
>
> So what Octave mention here, also x64-86? or

Hi Philip, again thanks for sticking with this.

At start-up the terminal says:
========================
GNU Octave, version 5.1.0
Copyright (C) 2019 John W. Eaton and others.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-w64-mingw32".
========================
Which looks like 64 bit to me.

> What does  "ver" in the terminal say?

"ver" gives 5.1.0 just as above, then a BIG dump of each loaded
package.  Do you need the full list?


> And what does the Octave command
>
> __octave_config_info__.build_environment.CC
>
> tell you?

 >> __octave_config_info__.build_environment.CC
ans = x86_64-w64-mingw32-gcc
 >>

It's got me stumped, at least.  Right now I'm focused more on the
discrepancies below, where Octave is apparently looking for "jvm.dll" in
the path "C:\Program Files\Java\jdk1.8.0_131/jvm.dll" but the correct
path is "C:\Program Files\Java\jdk1.8.0_131\jre\bin\server\jvm.dll"

It seems like if I could correct that one path variable it might start
working.

More answers below on getenv, yes I have a JAVA_HOME set.

>>   >> javaObject ("java.lang.Double", 5.3)
>> error: javaObject: could not find library or dependencies: C:\Program
>> Files\Java\jdk1.8.0_131/jvm.dll
>>   >>
>>
>> I can manually verify that there's no "jvm.dll" in the JRE/bin
>> subdirectory.  There is a "java.dll" however, maybe recent releases have
>> switched names?  Also the path that Octave uses seems messed up, there
>> should be a "/bin" at the end.
> Yeah Octave looks in the wrong place.
> E.g. on my Windows 7 system I have the jvm.dll in
> C:\Program Files\Java\jre-10.0.2\bin\server\
> (64-bit Java)
>
> Do you have a JAVA_HOME setting in your environment? (that could screw up
> things.)
> What does the Octave command
>
> getenv ("JAVA_HOME")
>
> return?

Yes, definitely this is set.  Tomcat (another program I run on my
workstation) requires it  It's:

 >> getenv ("JAVA_HOME")
ans = C:\Program Files\Java\jdk1.8.0_131
 >>

Which is the correct value for it to be set to.  Many programs and
documentation, including documentation directly from Oracle, require
JAVA_HOME to be set to the root of the JDK to be correct.

>
>
>> (So no top posting on this list?  That's different from most other lists
>> I'm on.  What about trimming quoted messages?  I personally don't need
>> to see every single message quoted in-line in an email.)
> It's the habit ("netiquette") here and on many many other mailing lists.
>
>
> I just adapt to the local habits.
>

It's fine I was just a little surprised.  Most (actually all) other
lists I'm top post regularly.  No worries I will adapt!

B.



Reply | Threaded
Open this post in threaded view
|

Re: New install, Java setup

PhilipNienhuis
Brenden,

Sorry for a late reply.
Read on ...


Brenden Towey wrote

>
> <snip>
> It's got me stumped, at least.  Right now I'm focused more on the
> discrepancies below, where Octave is apparently looking for "jvm.dll" in
> the path "C:\Program Files\Java\jdk1.8.0_131/jvm.dll" but the correct
> path is "C:\Program Files\Java\jdk1.8.0_131\jre\bin\server\jvm.dll"
>
> It seems like if I could correct that one path variable it might start
> working.
>> What does the Octave command
>>
>> getenv ("JAVA_HOME")
>>
>> return?
>
> Yes, definitely this is set.  Tomcat (another program I run on my
> workstation) requires it  It's:
>
>  >> getenv ("JAVA_HOME")
> ans = C:\Program Files\Java\jdk1.8.0_131
>  >>
>
> Which is the correct value for it to be set to.  Many programs and
> documentation, including documentation directly from Oracle, require
> JAVA_HOME to be set to the root of the JDK to be correct.

What surprises me is that Octave apparently just adds "/jvm.dll" to
JAVA_HOME rather than including the hierarchy below JAVA_HOME up to server/
I noted this on my Mageia Linux system as well.

FYI, there are some clues here:
https://savannah.gnu.org/bugs/?func=detailitem&item_id=40111

One of the comments there (#31) mentions that JAVA_HOME may only have
forward slashes for Octave being able to use it - can you try if that works
better?
If so, and if your other programs won't work anymore then, could you file a
bug report about JAVA_HOME needing to accept backward slashes on Windows.

Philip




--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html