Feature #989
RCP: X.X, embed a jre in TXM setups
Status: | Closed | Start date: | 02/16/2015 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | - | % Done: | 100% |
|
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
- No need to modify setup building Bash scripts: add the jre files in org.txm.setups/trunk/archs/TXM directories
- Find a JRE for all architectures (Linux 32bit, Linux 64bit, Windows 32bit, Windows 64bit and Mac OS X 64bit)
- OpenJDK 6: https://github.com/alexkasko/openjdk-unofficial-builds#openjdk-unofficial-installers-for-windows-linux-and-mac-os-x
- no Mac OS X version available
- OpenJDK7 (IceTea http://icedtea.classpath.org/wiki/Main_Page)
- jre installers https://github.com/alexkasko/openjdk-unofficial-builds#openjdk-unofficial-installers-for-windows-linux-and-mac-os-x
- ++ free
- ++ same jre than the dev jre
- ++ works with Mac OS X
- - not much used with Windows and Mac OS X
- Oracle Java 6 : http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR
- no Oracle Mac OS X version available. We must use another one and ensure that it works for Mac OS X 10.6 to 10.9 :
- OpenJDK seems available https://wiki.openjdk.java.net/display/BSDPort/Main
- An apple Jvm seems also available : http://support.apple.com/kb/DL1572
- Also see: http://www.macupdate.com/app/mac/33087/apple-java-for-mac-os-x-10.6, it may be the JVM version used for the tests about the bug #1255 (SWT_AWT bridge bug in Java 1.7 and 1.8). The complete version name used for these tests is 1.6.0_65-b14-462
- no Oracle Mac OS X version available. We must use another one and ensure that it works for Mac OS X 10.6 to 10.9 :
- Oracle Java 7 http://www.oracle.com/technetwork/java/javase/downloads
- it represents +40Mo for the setup and +160Mo for the installation files (65Mo for rt.jar and 60Mo for architecture dependent libs)
- + most used jre
- -- does not work with Mac OS X. Eclipse raise an error : "The JVM shared library "/Applications/TXM/TXM/jre/Contents/Home/jre/bin/../lib/server/libjvm.dylib" does not contains the JNI_CreateJavaVM symbol"
- OpenJDK 6: https://github.com/alexkasko/openjdk-unofficial-builds#openjdk-unofficial-installers-for-windows-linux-and-mac-os-x
- The Mac OS X launcher fails to find the OpenJDK6 jre files, so we decided to not use it and call directly the JAR launcher file
- The Windows NSIS calls DetectJVM.exe which run a Jar file that detect if a JVM is installed. For now, this must be removed. Thus there is no need to detect if any JVM is installed.
- The Linux debian packages have 2 openjdk dependencies that must be removed (from the control file)
- 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¶
- Open TXM about dialog
- Open "Install details"
- select "Configurations" tab
- 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
Related issues
History
#1 Updated by Matthieu Decorde over 8 years ago
- Description updated (diff)
#2 Updated by Matthieu Decorde over 8 years ago
- % Done changed from 0 to 10
#3 Updated by Serge Heiden over 8 years ago
- Description updated (diff)
#4 Updated by Serge Heiden over 8 years ago
- Description updated (diff)
#5 Updated by Serge Heiden over 8 years ago
- Description updated (diff)
#6 Updated by Serge Heiden over 8 years ago
- Description updated (diff)
#7 Updated by Sebastien Jacquot over 8 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 8 years ago
- Target version changed from TXM 0.7.7 to TXM 0.7.8
#9 Updated by Matthieu Decorde about 8 years ago
- Target version changed from TXM 0.7.8 to TXM 0.7.7
#10 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#11 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#12 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#13 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#14 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#15 Updated by Matthieu Decorde about 8 years ago
- % Done changed from 10 to 60
#16 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#17 Updated by Serge Heiden about 8 years ago
- Description updated (diff)
#18 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#19 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#20 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
- % Done changed from 60 to 70
Wor
#21 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#22 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#23 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#24 Updated by Sebastien Jacquot about 8 years ago
- Description updated (diff)
#25 Updated by Matthieu Decorde about 8 years ago
- Status changed from New to Feedback
#26 Updated by Sebastien Jacquot about 8 years ago
- Description updated (diff)
#27 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#28 Updated by Sebastien Jacquot about 8 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 about 8 years ago
- Description updated (diff)
#30 Updated by Matthieu Decorde about 8 years ago
- Description updated (diff)
#31 Updated by Sebastien Jacquot about 8 years ago
- Description updated (diff)
- Status changed from Feedback to New
#32 Updated by Sebastien Jacquot about 8 years ago
- Description updated (diff)
#33 Updated by Sebastien Jacquot about 8 years ago
- Description updated (diff)
#34 Updated by Matthieu Decorde almost 9 years ago
- Description updated (diff)
#35 Updated by Matthieu Decorde almost 9 years ago
- Description updated (diff)
#36 Updated by Sebastien Jacquot almost 8 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 almost 8 years ago
- Description updated (diff)
#38 Updated by Matthieu Decorde almost 8 years ago
- Description updated (diff)
#39 Updated by Sebastien Jacquot almost 8 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.
- http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fmisc%2Flauncher.html
- https://www.eclipse.org/equinox/framework/
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.dylibHere is a list of potential linked Eclipse issues:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=442324
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=411361
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=444201
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=449428
The last issue link seems to be especially interesting.
The C source of the native launcher:
#40 Updated by Sebastien Jacquot almost 8 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 almost 8 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 over 7 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 over 7 years ago
- Description updated (diff)
#44 Updated by Matthieu Decorde over 7 years ago
- Description updated (diff)
#45 Updated by Sebastien Jacquot almost 7 years ago
- Status changed from New to Closed