Multibit-Legacy / multibit

Deprecated Bitcoin Wallet
https://multibit.org
MIT License
461 stars 395 forks source link

multibit-classic-unix-0.5.19.sh fails to install #732

Open dooglus opened 8 years ago

dooglus commented 8 years ago

I downloaded the latest classic Unix installer from:

https://multibit.org/releases/multibit-classic/multibit-classic-0.5.19/multibit-classic-unix-0.5.19.sh

Running it fails to find the jvm in the unpacked directory:

bash -x ./multibit-classic-unix-0.5.19.sh
+ echo 'Starting Installer ...'
Starting Installer ...
+ /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.3605.dir/jre/bin/java -Dinstall4j.jvmDir=/home/chris/Downloads/multibit-classic-unix-0.5.19.sh.3605.dir/jre -Dexe4j.moduleName=/home/chris/Downloads/multibit-classic-unix-0.5.19.sh -Dexe4j.totalDataLength=3934488 -Dinstall4j.cwd=/home/chris/Downloads -Dsun.java2d.noddraw=true -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4jv=0 -Di4j.vpt=true -classpath i4jruntime.jar:user.jar com.install4j.runtime.launcher.UnixLauncher launch 0 '' '' com.install4j.runtime.installer.Installer
./multibit-classic-unix-0.5.19.sh: line 550: /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.3605.dir/jre/bin/java: No such file or directory
+ returnCode=127

In the jre/ folder I see no bin/, only another nested jre/ (which also contains no bin/).

gary-rowe commented 8 years ago

Hi @dooglus - thanks for trying out MBHD and sorry for the delay in responding.

The Linux installer doesn't ship with a JVM since there are too many variants in the Linux world. We recommend users install either OpenJDK or the Oracle JVM themselves. The Linux install guide is here: https://multibit.org/en/help/hd0.1/how-to-install-linux.html and provides several scripts that can ease the setup process.

It may be that you need to install the JVM first in your scenario.

Let me know how you get on and I'll do what I can to help.

dooglus commented 8 years ago

I have a JVM, and I'm trying classic, not HD.

The installer shell script itself is looking for the JVM in the distribution, but it doesn't exist there.

gary-rowe commented 8 years ago

Thanks for the correction - too many repos to look after these days!

After digging into the installer script it appears to be the same one as MBHD in terms of the JRE dependency (i.e. none for Unix). I've tested installation on my Ubuntu (and OS X) test machines and it works fine.

It may be that you have an unusual location for your JVM that is off the path. You can add an environment variable to help Install4j to find it: INSTALL4J_JAVA_HOME_OVERRIDE=/path/to/jre

You might also want to try launching in debug mode with logging to stderr so it shows up in the console:

./multibit-classic-unix-0.5.19.sh -Dinstall4j.debug=true -Dinstall4j.logToStderr=true

There are more command line options to be found here: http://resources.ej-technologies.com/install4j/help/doc/helptopics/installers/options.html

I'm interested to find out what's causing this and hopefully I can write up a better install guide for Classic on Linux.

dooglus commented 8 years ago

No dice:

$ java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
$ type java
java is hashed (/usr/bin/java)

$ INSTALL4J_JAVA_HOME_OVERRIDE=/usr/bin bash -x multibit-classic-unix-0.5.19.sh 2>&1 | grep such
multibit-classic-unix-0.5.19.sh: line 550: /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.12525.dir/jre/bin/java: No such file or directory

$ /usr/lib/jvm/default-java/bin/java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)

$ INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/default-java bash -x multibit-classic-unix-0.5.19.sh 2>&1 | grep such
multibit-classic-unix-0.5.19.sh: line 550: /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.12577.dir/jre/bin/java: No such file or directory
gary-rowe commented 8 years ago

I may be misreading your command shell, but I think the INSTALL4J_JAVA_HOME_OVERRIDE is used as follows:

$ whereis java
$ export INSTALL4J_JAVA_HOME_OVERRIDE=/whereis/symlink/not/bin
$ ./multibit-classic-unix-0.5.19.sh -Dinstall4j.debug=true -Dinstall4j.logToStderr=true

Is that what you're doing because it appears to be a bit mangled.

If that isn't helping, just forget the override and concentrate on the script parameters.

dooglus commented 8 years ago

It's not mangled. It's probably just a way of setting environment variables you didn't see before.

export x=y
./program

is equivalent to:

x=y ./program

in pretty much any shell I've used in the last 10 years, except that it doesn't leave the variable in your environment once the program is done.

Demo:

$ v=23
$ bash -c 'echo $v' # sub-process doesn't see v - it's not exported

$ v=24 bash -c 'echo $v' # sub-process sees v
24
$ echo $v # but local setting isn't changed
23
$ env | grep v= # and local environment isn't polluted
$ export v=25 # we can export it
$ bash -c 'echo $v' # then the sub-process sees it
25
$ env | grep v= # but then the local environment is polluted
v=25
$ 
dooglus commented 8 years ago

I just tried with the -D flags you suggested:

$ ./multibit-classic-unix-0.5.19.sh -Dinstall4j.debug=true -Dinstall4j.logToStderr=true
Unpacking JRE ...
Starting Installer ...
./multibit-classic-unix-0.5.19.sh: 550: ./multibit-classic-unix-0.5.19.sh: /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.13361.dir/jre/bin/java: not found
$ 
gary-rowe commented 8 years ago

Sorry, I didn't make myself clear. My intention with the "mangling" comment was that INSTALL4J_JAVA_HOME_OVERRIDE variable is to identify the JVM home (not bin) so using /usr/bin is unlikely to work.

Can you follow the symlinks from your /usr/bin/java to locate the actual JVM home (e.g. /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands on OS X) and use that in your INSTALL4J_JAVA_HOME_OVERRIDE entry?

My suspicion is that your installation of Java is not in any of the locations that Install4j considers to be standard so it is not able to find it during its startup process. In the 0.5.19 install script these are:

common_jvm_locations="/opt/i4j_jres/* /usr/local/i4j_jres/* $HOME/.i4j_jres/* /usr/bin/java* /usr/bin/jdk* /usr/bin/jre* /usr/bin/j2*re* /usr/bin/j2sdk* /usr/java* /usr/java*/jre /usr/jdk* /usr/jre* /usr/j2*re* /usr/j2sdk* /usr/java/j2*re* /usr/java/j2sdk* /opt/java* /usr/java/jdk* /usr/java/jre* /usr/lib/java/jre /usr/local/java* /usr/local/jdk* /usr/local/jre* /usr/local/j2*re* /usr/local/j2sdk* /usr/jdk/java* /usr/jdk/jdk* /usr/jdk/jre* /usr/jdk/j2*re* /usr/jdk/j2sdk* /usr/lib/jvm/* /usr/lib/java* /usr/lib/jdk* /usr/lib/jre* /usr/lib/j2*re* /usr/lib/j2sdk* /System/Library/Frameworks/JavaVM.framework/Versions/1.?/Home /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/Contents/Home /Library/Java/JavaVirtualMachines/*.jdk/Contents/Home/jre"
dooglus commented 8 years ago

I followed the symlinks, but that didn't help. I also moved the whole installation to /usr/local/java which is in the list of places you just told me, but that didn't help either:

$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Aug  9 05:08 /usr/bin/java -> /etc/alternatives/java
$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 46 Aug  9 05:08 /etc/alternatives/java -> /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
$ ls -l /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
-rwxr-xr-x 1 root root 6368 Jul 24 08:06 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java
$ cd ~/Downloads
$ INSTALL4J_JAVA_HOME_OVERRIDE=/usr/lib/jvm/java-7-openjdk-amd64/jre ./multibit-classic-unix-0.5.19.sh -q -Dinstall4j.debug=true -Dinstall4j.logToStderr=true -Dinstall4j.detailStdout=true
Unpacking JRE ...
Starting Installer ...
./multibit-classic-unix-0.5.19.sh: 550: ./multibit-classic-unix-0.5.19.sh: /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.22590.dir/jre/bin/java: not found
$ ls -l /usr/local/java
ls: cannot access /usr/local/java: No such file or directory
$ sudo mv /usr/lib/jvm/java-7-openjdk-amd64/jre /usr/local/java
[sudo] password for chris: 
$ /usr/local/java/bin/java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
$ ./multibit-classic-unix-0.5.19.sh -Dinstall4j.debug=true -Dinstall4j.logToStderr=true -Dinstall4j.detailStdout=true
Unpacking JRE ...
Starting Installer ...
./multibit-classic-unix-0.5.19.sh: 550: ./multibit-classic-unix-0.5.19.sh: /home/chris/Downloads/multibit-classic-unix-0.5.19.sh.22666.dir/jre/bin/java: not found
$ sudo mv /usr/local/java /usr/lib/jvm/java-7-openjdk-amd64/jre
$ /usr/bin/java -version
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.6) (7u79-2.5.6-1~deb8u1)
OpenJDK 64-Bit Server VM (build 24.79-b02, mixed mode)
$ 
jim618 commented 8 years ago

Hi Chris, Sorry you are having so much trouble with our startup script.

If you want to go real old school and simply get MultiBit working you can invoke the jar file directly.

If you navigate to where the multibit-exe.jar is stored (in your installation directory) then you should be able to invoke it with:

$ java -jar multibit-exe.jar

(You might need to use '/usr/bin/java' as I can see from your logging that you definitely can see the java version at that path).