initialising h2o in Rstudio : not recognising 64-bit java - java

I work on Rstudio running on a dedicated linux server. I get an error initialising h2o:
> h2o.init()
H2O is not running yet, starting it now...
<simpleError in system2(command, "-version", stdout = TRUE, stderr = TRUE): error in running command>
Error in value[[3L]](cond) :
You have a 32-bit version of Java. H2O works best with 64-bit Java.
Please download the latest Java SE JDK 8 from the following URL:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
I checked the java config and got:
system("java -version")
openjdk version "1.8.0_77"
OpenJDK Runtime Environment (build 1.8.0_77-b03)
OpenJDK 64-Bit Server VM (build 25.77-b03, mixed mode)
Apparently I have the good version of java. I have found people with similar problems on Windows. They were able to solve the problem by finding and indicating the good java path. However in the environnement I am working in, i am not sure how to do that.
Any idea on how to solve the problem ? to bypass the error ?

Check if the JAVA_HOME environment variable is set. It may be pointing to the wrong spot, tricking H2O to find the wrong one.
You want JAVA_HOME/bin/java to be a good 64-bit java.
(The other thing you can optionally do is, when you do find a 32-bit java, uninstall it. There is no real reason to have it unintentionally anymore these days; memory sizes are much bigger than 15 years ago.)

Related

cacerts - incompatibility Open JDK/JRE vs. Oracle JDK/JRE? [duplicate]

This question already has answers here:
Error - trustAnchors parameter must be non-empty
(45 answers)
Closed 1 year ago.
Is there a known difference or incompatibility of some sort between
cacerts file (or cacerts file format) when used under Oracle JDK/JRE 8 vs. Open JDK/JRE 8?
I mean... it seems we have a cacerts file which works OK with:
(1) Oracle JRE 8 (CentOS release 6.8)
but does not work OK with
(2) Open JRE 8 (CentOS release 6.10).
The Java version on system (1) is
java version "1.8.0_181"
Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)
while on system (2) it is
openjdk version "1.8.0_232"
OpenJDK Runtime Environment (build 1.8.0_232-b09)
OpenJDK 64-Bit Server VM (build 25.232-b09, mixed mode)
The error we get is this one:
java.lang.RuntimeException: Unexpected error:
java.security.InvalidAlgorithmParameterException:
the trustAnchors parameter must be non-empty
Is that possible to be due to the JRE being different or am I completely off base and the issue is elsewhere?
I am not finding any good explanation on the web.
cacerts sees updates in minor version updates of java. There is no difference between oracleJRE8 and OpenJRE8. As a sidenote, JRE as a concept is obsolete, please transition away from them (if you(r company) wrote the software and are running it yourself, run it on a full JDK. If someone else did, advise them they are using an obsolete stack; they should be giving you the runtime instead of asking you to download and install one and keep it up to date).
A bunch of other stuff has been changed, such as the default format (instead of JKS, it's PKCS12), but that only affects what happens when you make new keystores without explicitly specifying which format it should be in (java could, and can, read either format, for all versions of java8) - so that doesn't sound relevant.
It boils down to: No, there is no difference. Whatever problem you have is most likely either related to your platform (for example, ubuntu has a bug where it borks up your cacerts. Long fixed, but maybe you're on that exact version, or you were when you ran apt and ended up with a broken cacerts). That or a million other reasons - no way to tell without more information.

pyimagej setup + conda: No Java runtime present, requesting install

Problem
I'm trying to use pyimagej==0.4.0 (source). Per its README, I run the following code:
import imagej
ij = imagej.init()
And it returns the following error: No Java runtime present, requesting install.
I looked up this error in multiple articles:
Even though JRE 8 is installed on my MAC -" No Java Runtime present,requesting to install " gets displayed in terminal
https://apple.stackexchange.com/q/283858/327668
Both articles say I need the full JDK, not just the JRE. However, I think I have the full JDK.
Background
pyimagej==0.4.0
macOS Mojave v10.14.3
miniconda 4.6.14
Set up conda environment with:
conda create -n pyimagej pyimagej openjdk=8
conda activate pyimagej
Checking environment:
(pyimagej) ➜ fiji_test java -version
openjdk version "1.8.0_192"
OpenJDK Runtime Environment (Zulu 8.33.0.1-macosx) (build 1.8.0_192-b01)
OpenJDK 64-Bit Server VM (Zulu 8.33.0.1-macosx) (build 25.192-b01, mixed mode)
(pyimagej) ➜ fiji_test echo $JAVA_HOME
/usr/local/Caskroom/miniconda/base/envs/pyimagej
Can you please fill in what am I missing? Thank you in advance for any advice.
Well it turns out the problem was quite in the weeds.
It seems this problem was encountered by one of pyimagej's developers here: https://github.com/imagej/pyimagej/issues/10
The developer posed a short-term workaround of directly modifying the jdk's Info.plist.
The developer also opened a PR for a more long-term solution. Hopefully it gets closed, and then hopefully no one else will encounter this! :)

Android SDK on Debian linux has blank windows

Windows show like this:
Thinking it might be OpenJDK's fault, I downloaded Java SE JDK and pointed the run script to it. This did not appear to help.
Not sure what information to provide, other than being on debian jessie, using awesomewm, and:
~$ java -version
java version "1.7.0_75"
OpenJDK Runtime Environment (IcedTea 2.5.4) (7u75-2.5.4-2)
OpenJDK 64-Bit Server VM (build 24.75-b04, mixed mode)
Leaving this up just in case someone stumbles on it. Apparently java, in many forms, has problems with a few wms. Awesomewm included. One needs to export a 'nonparenting' variable:
export _JAVA_AWT_WM_NONREPARENTING=1
Maybe someone will come along and offer a more fulfilling answer to this problem.

Neo4j Java 7 Terminal Issue

I'm having issues starting my neo4j instance (2.0.0 M03). I have java 7 installed as indicated in the code block below but when trying to start neo4j it apparently does not recognize this, gives and error and does not start. The terminal output is below. Any ideas on how to fix this or what exactly is going wrong? Thanks a lot.
Tim-Bornys-MacBook-Pro:neo4j community 2.0.0 M03 BornyTM$ java -version
java version "1.7.0_25"
Java(TM) SE Runtime Environment (build 1.7.0_25-b15)
Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
Tim-Bornys-MacBook-Pro:neo4j community 2.0.0 M03 BornyTM$ bin/neo4j start
WARNING! You are using an unsupported version of the Java runtime. Please use Oracle(R) Java(TM) Runtime Environment 7.
Starting Neo4j Server...WARNING: not changing user
process [88317]... waiting for server to be ready.... Failed to start within 120 seconds.
Neo4j Server may have failed to start, please check the logs.
The problem was JAVA_HOME was not set to the correct JVM. To determine where you have your instance installed you can enter the following into terminal:
/usr/libexec/java_home -v 1.7
This should return the location, in my case: /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/
To set JAVA_HOME just export pointing towards the location like below (enter into the console):
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/

How to get remote debugging work for Java on Solaris

I am trying to get remote debugging working with Java on Solaris OS. Following is what I have tried-
I have a Java class called TestP which has the main method.
When I try
java -classpath . TestP
the program works fine. But when I try adding the debug parameters to the JVM-
java -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=n -classpath . TestP
It fails giving this error-
UTF ERROR ["../../../src/solaris/npt/utf_md.c":49]: Failed to complete iconv_open() setup
Can anyone please help me on figuring out why this error is coming up?? The above works fine on my Linux box.
Java version on Solaris:
Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode)
Java version on Linux:
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.5) (fedora-20.b16.fc10-i386)
OpenJDK Server VM (build 14.0-b15, mixed mode)
Hmm... This seems to be a known Solaris (not specific to Solaris 10) issue with Java 6, not a Java issue (see this thread).
Someone has successfully applied a workaround (see this blog post) from a Sun guy, Jeff Moguillansky, but I wouldn't recommend it and rather consider searching sunsolve for a patch as indicated on Sun's forums.
Look at this one: http://sunsolve.sun.com/search/document.do?assetkey=1-1-6586755-1 (you'll need a Sun Online Account with a valid Support Contract or Software Subscription).
Using truss I found out that the process was looking for /usr/lib/iconv/geniconvtbl/binarytables/UTF-8%646.bt and 646%UTF-8.bt, so I just copied ISO8859-1%ISO646.bt to UTF-8%646.bt and ISO646%ISO8859-1.bt to 646%UTF-8.bt (yes, it is "646", not "ISO646"!)
This is of course a very ugly workaround and I have no idea if it has any negative effects on the JVM, but at least it starts the JVM without aborting. (I did this on OpenSolaris 2009.06, btw)
If Pascal Thivent is right, then you may want to try running OpenSolaris (either on a blank machine or in a vm) and see if the problem is also there. If not, then consider using that version for now if possible.

Categories