Feature #989

RCP: X.X, embed a jre in TXM setups

Added by Matthieu Decorde over 4 years ago. Updated about 3 years ago.

Status:Closed Start date:02/16/2015
Priority:Normal Due date:
Assignee:- % Done:

80%

Category:Setup Spent time: -
Target version:TXM 0.7.7 Estimated time:5.00 hours

Description

Currently, TXM must be installed in an environment where Java is already installed (typically as a JRE).

This has several drawbacks:
  • users must install a compatible Java themselves and it can be difficult to do (find it on the web, choose the right architecture 32/64-bit, the right version, some vendors like Apple sometime change their policy with respect to Java, sometimes there are temporary security risks for some versions or libraries, etc.), adding difficulties globally to run TXM on a machine
  • this adds another component to the already big list of independant installations needed to run TXM on a machine (Java, TreeTagger software, TreeTagger models, TXM setup) resulting in a long and error prone installation process and not very practical for users (the ideal scenario for a software installation process is to launch just one installer software and that the installation process is the most automatic)
  • if different Java versions can run TXM in a given environment we have the risk that TXM behavior can be different between them (typically at the borderline of the Java language specification - preemptive threads, etc. - or different versions of hosted Java libraries), and this can be very difficult to support and maintain from the point of view of TXM
  • last but not least, Java suffers from its reputation of slowness and security risk in browser applets. Putting Java less in the front would help users to concentrate more on the right components for performance issues (like CQP search engine for example which is not written in Java) and not be needlessly alarmed about security risks (TXM execution context is not in an applet).

Embedding a JRE in TXM will greatly simplify TXM users and developers life.

See also https://groupes.renater.fr/wiki/txm-info/public/passage_de_java_6_a_java_7

Definition of Java

Java is implemented by a JVM and its environment called a JRE.

Oracle produces a Java version (http://www.oracle.com/technetwork/java/javase/downloads/index.html) based on the OpenJDK project (http://openjdk.java.net).

Java is available in a JDK. A JDK contains a JRE as the 'jre' sub-directory : '

Note that the file structure of the JRE is identical to that of the JDK's  jre directory.

(see http://docs.oracle.com/javase/7/docs/technotes/tools/windows/jdkfiles.html)

Solution
  • First choice was the OpenJDK 7
    • but there is a bug in some 1.7 versions with the SWT_AWT bridge on Mac OS X/Cocoa
  • So we decided to downgrade to OpenJDK 6
    • There is no OpenJDK 6 available for Mac OS X

See also "inclusion d'une JRE dans le logiciel": https://groupes.renater.fr/wiki/txm-info/documentation_java

Validation Test with the OpenJDK 7

  1. Open TXM about dialog
  2. Open "Install details"
  3. select "Configurations" tab
  4. in the ordered list of properties you must find :
    ...
    java.runtime.name=OpenJDK Runtime Environment
    java.runtime.version=1.7.0-u60-unofficial-b30
    java.specification.name=Java Platform API Specification
    java.specification.vendor=Oracle Corporation
    java.specification.version=1.7
    java.vendor=Oracle Corporation
    java.vendor.url=http://java.oracle.com/
    java.vendor.url.bug=http://bugreport.sun.com/bugreport/
    java.version=1.7.0-u60-unofficial
    java.vm.info=mixed mode
    java.vm.name=OpenJDK 64-Bit Server VM
    java.vm.specification.name=Java Virtual Machine Specification
    java.vm.specification.vendor=Oracle Corporation
    java.vm.specification.version=1.7
    java.vm.vendor=Oracle Corporation
    java.vm.version=24.60-b09 
    ...
    

To ensure this is not the current system jvm, in a terminal call :

java -version

Ubuntu

Ubuntu 14.04 64bit: OK (MD)
Ubuntu 13.04 64bit (VM): OK (SJ)
Ubuntu 12.04 32bit: OK (MD)
Ubuntu 14.04 32bit: OK (MD)

Windows

Windows 7 32bit: OK (MD)
Windows 7 64bit: OK (MD, SJ)
Windows XP (VM): OK (MD)
Windows XP: OK (SJ)

Mac OS X

Mac OS X 10.6: Java 7 (Oracle) is not supported for Mac OS X < 10.7 ; NOR with openjdk unofficial
Mac OS X 10.7+: OK with openjdk unofficial
Mac OS X 10.6: with openjdk: starts but then crashes
Mac OS X 10.9.4 (VM): OK (SJ)


Subtasks

Task #1255: RCP: X.X, Don't use Java during TXM installationNew


Related issues

related to Bug #1006: RCP: Charts editor, Mac OS X, When creating or reopening ... New 09/11/2014
related to Bug #1005: RCP: Charts editor, Ubuntu, When reopening a chart editor... New 09/11/2014
related to Bug #766: RCP: 0.7.6, Tooltip transparency of chart entities doesn'... New 04/29/2014
related to Bug #1127: RCP: 0.7.6, focus bugs in chart editors Feedback 09/11/2014
related to Feature #1259: RCP: X.X, Mac OS X R package installation scheme New 02/20/2015

History

#1 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#2 Updated by Matthieu Decorde over 4 years ago

  • % Done changed from 0 to 10

#3 Updated by Serge Heiden over 4 years ago

  • Description updated (diff)

#4 Updated by Serge Heiden over 4 years ago

  • Description updated (diff)

#5 Updated by Serge Heiden over 4 years ago

  • Description updated (diff)

#6 Updated by Serge Heiden over 4 years ago

  • Description updated (diff)

#7 Updated by Sebastien Jacquot over 4 years ago

NOTE: A lot of graphics rendering and SWT <-> Swing event/communication behaviors seems to be strongly related to the current JVM, Java version and OS.

#8 Updated by Sebastien Jacquot over 4 years ago

  • Target version changed from TXM 0.7.7 to TXM 0.7.8

#9 Updated by Matthieu Decorde over 4 years ago

  • Target version changed from TXM 0.7.8 to TXM 0.7.7

#10 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#11 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#12 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#13 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#14 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#15 Updated by Matthieu Decorde over 4 years ago

  • % Done changed from 10 to 60

#16 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#17 Updated by Serge Heiden over 4 years ago

  • Description updated (diff)

#18 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#19 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#20 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)
  • % Done changed from 60 to 70

Wor

#21 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#22 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#23 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#24 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#25 Updated by Matthieu Decorde over 4 years ago

  • Status changed from New to Feedback

#26 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#27 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#28 Updated by Sebastien Jacquot over 4 years ago

It seems Java 6 and below was released by Apple. See http://support.apple.com/kb/DL1572 for a possible version of Java 6.

#29 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#30 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#31 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)
  • Status changed from Feedback to New

#32 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#33 Updated by Sebastien Jacquot over 4 years ago

  • Description updated (diff)

#34 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#35 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#36 Updated by Sebastien Jacquot over 4 years ago

TODO: add java.home to verifications in the Validation tests of this issue. java.home path must point to the location of the embedded JRE, Mac example:

java.home=/Applications/TXM/TXM/jre/Contents/Home

#37 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#38 Updated by Matthieu Decorde over 4 years ago

  • Description updated (diff)

#39 Updated by Sebastien Jacquot over 4 years ago

On Mac OS X 1.9, the native Eclipse launcher (.main.app) opens a pop up asking to install a JRE 1.6 if no system JRE is installed but also if a system JRE is installed bit the version is not 1.6.
At this moment, we don't know if it's a bug of the native launcher or if it's because the launcher does not find the embedded JRE that we give to it with the -vm arg in TXM.ini.

Here are the native launcher doc and source entries:

Here are the tests on JRE paths I did on Mac OS X 10.9.4 VM, in the TXM.ini file and running:

open /Applications/TXM/TXM/.main.app --args -run --launcher.ini "$HOME/.txm/TXM.ini" -data "$HOME/.txm/data" -user "$HOME/.txm/user" -install "/Applications/TXM/TXM" &

in TXM.app. These tests do not work and prompt for installing a JRE 6:

-vm
/Applications/TXM/TXM/jre/Contents/Home/bin/java
-vm /Applications/TXM/TXM/jre/Contents/Home/bin/java
-vm
/Applications/TXM/TXM/jre/Contents/MacOS/libjava.jnilib
-vm /Applications/TXM/TXM/jre/Contents/MacOS/libjava.jnilib
-vm
/Applications/TXM/TXM/jre/Contents/Libraries/libclient.dylib
-vm /Applications/TXM/TXM/jre/Contents/Libraries/libclient.dylib
-vm
/Applications/TXM/TXM/jre/Contents/Libraries/libjvm.dylib
-vm /Applications/TXM/TXM/jre/Contents/Libraries/libjvm.dylib
-vm
/Applications/TXM/TXM/jre/
-vm /Applications/TXM/TXM/jre/

After some readings, it seems the chariot return after "-vm" has its importance in the process.

Some other tests after having moved the JRE inside the TXM.app package, I will complete this list:

-vm
/Applications/TXM/TXM.app/Contents/jre/Contents/Libraries/libjvm.dylib
Here is a list of potential linked Eclipse issues:

The last issue link seems to be especially interesting.

The C source of the native launcher:

#40 Updated by Sebastien Jacquot over 4 years ago

Using this command line, instead of "open", I now have some debug output messages:

/Applications/TXM/TXM/.main.app/Contents/MacOs/TXM --args -run --launcher.ini "$HOME/.txm/TXM.ini" -data "$HOME/.txm/data" -user "$HOME/.txm/user" -install "/Applications/TXM/TXM" 

For example with:


-vm
/Applications/TXM/TXM/jre/Contents/Libraries/libjvm.dylib

I have this log message in terminal:

dlopen(/Applications/TXM/TXM/jre/Contents/Libraries/libclient.dylib, 2): no suitable image found.  Did find:
    /Applications/TXM/TXM/jre/Contents/Libraries/libclient.dylib: mach-o, but wrong architecture

and a pop up with this message:

Alert
Failed to load the JNI shared library "/Applications/TXM/TXM/jre/Contents/Libraries/libjvm.dylib" 

So as Serge said, it seems the JRE 1.6 asking pop up is generated by the system, not by the native launcher, because the launcher does not find the embedded JRE and/or because the JRE launching fails.

A similar issue here, but with Java 7: Some doc:

#41 Updated by Sebastien Jacquot about 4 years ago

We need to clarify this issue, to list the exact JRE versions used for OS, to store these JRE somewhere.
We also need to write somewhere (setup dialogs + minimum requirements Web pages?) that TXM now won't need anymore an installed JRE except for Mac OS 10.6. (and what about 10.7 and 10.8?)
Also need to clearly explain how is ran the native launcher or .jar launcher according to the OS X versions.

#42 Updated by Sebastien Jacquot about 4 years ago

Closed for redundancy, see #1358 for next steps.
Also see: https://groupes.renater.fr/wiki/txm-info/public/jre_embedding

#43 Updated by Serge Heiden almost 5 years ago

  • Description updated (diff)

#44 Updated by Matthieu Decorde almost 5 years ago

  • Description updated (diff)

#45 Updated by Sebastien Jacquot about 3 years ago

  • Status changed from New to Closed

Also available in: Atom PDF