Task #1346

Updated by Sebastien Jacquot about 5 years ago

OS detection in TBX is actually done by strings comparison and used in various places, e.g. System.getProperty("os.name").contains("win32") for Windows.
On some systems, System.getProperty("os.name") now returns "Windows 7" on Windows 7 OS leading to a failure of R/CQP launching on Win 7 because the Linux launching native code is executed instead of Win native code. Result in log is:

<pre>
Failed to start RServe : org.txm.stat.engine.r.RWorkspaceException: ** The Statistics Engine program path is set but we couldn't find it : C:\XXXXXX\R\bin\R.exe

</pre>

h3. Solution 1

* use org.ecplise.core.runtime.Platform.getOS()
* bundle is present in TBX project
* NOTE: using Platform.getOS() in TBX layer leads to an Eclipse classloader problem in TXM Web/Portal layer. This solution 1 was used since revision 2967 layer

h3. Solution 2

* use org.apache.tools.ant.taskdefs.condition.Os
* bundle is present in TBX project

h3. Solution 3

* org.apache.commons.exec.OS
* bundle is NOT present in TBX project

h3. Solution 4

* implement own custom class using System.getProperty("os.name")

h3. Solution 5

* use solution 1, 2 or 3
* centralize/encapsulate the OS detection code in a class, e.g. OSDetector in TBX layer to minimize impact of further string definition potential changes

Back