Hi All
Is there a possibility to read the java library path within Servoy, i. e. in a Servoy module? Something like the eqivalent of System.getProperty(“java.library.path”) in Java?
Hi All
Is there a possibility to read the java library path within Servoy, i. e. in a Servoy module? Something like the eqivalent of System.getProperty(“java.library.path”) in Java?
You can use java code directly in Servoy:
application.output(java.lang.System.getProperty("java.library.path"))
To supplement Patrick’s reply here is a function that I use to figure out all properties:
function getSystemProperties() {
/** @type {java.util.Properties} */
var props = java.lang.System.getProperties();//Properties object returned
/** @type {java.util.Enumeration} */
var enumeration = props.propertyNames();
while (enumeration.hasMoreElements()){
/** @type {String} */
var prop = enumeration.nextElement();
application.output('property: ' + prop);
}
/** @type {String} */
var libPath = java.lang.System.getProperty('java.library.path');
var array_libPath = libPath.split(';');
for (path in array_libPath){
application.output('library path[' + path + '] = ' + array_libPath[path]);
}
return;
}
Hi,
small change :
If you replace
application.output('property: ' + prop);
by
application.output('property: ' + prop + ' = ' + java.lang.System.getProperty(prop));
it will not just show the key, but also the value of that key
Regards and thanks to Thomas
Thanks a lot to all of you for the quick reply, that helped a lot in tracking down the problem of not being able to use the SQL Anywhere JDBC4 driver sajdbc.jar, but being able to use the jconn3.jar driver.