View Full Version : verify license when link JMSL

11-29-2007, 01:39 AM
hi all

when i link jmsl.jar, i need to add -Dcom.imsl.license.path=license in command line, is that posibble to add this parameter in my java program?

java -Dcom.imsl.license.path="c:\jmsl4.0\license\license.dat" -classpath .;"C:\jmsl4.0\lib\jmsl.jar" test

i want to do like this:
java -classpath .;"C:\jmsl4.0\lib\jmsl.jar" test

any suggestion will appreciate~

11-30-2007, 11:05 AM
Hello Arthur,

This is really a system property designation that you are providing at the command line (property: com.imsl.license.path value: @server). As with any properties in Java there are alternatives.

Web Start:

<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://../webstart/injnlp/" href="areaex.jnlp">
<title>WebStart Test</title>
<vendor>Visual Numerics, Inc.</vendor>
<description>WebStart Test</description>
<homepage href="../index.html"/>
<j2se version="1.4+"/>
<jar href="areaex.jar" main="true"/>
<jar href="jmsl.jar"/>
<property name="com.imsl.license.path" value="@server"/>
<application-desc main-class="AreaEx"/>

In a program (This example actually provides a dialog for the user to specify the location before setting the property):

public static void main(String args[]) {

String location = null;
location = JOptionPane.showInputDialog(null,"Please specify the location of your license server.", "FlexLM Location", JOptionPane.QUESTION_MESSAGE);
if (location == null) System.exit(0);
System.setProperty("com.imsl.license.path", location);
new AreaEx().show();

I hope this helps.



12-07-2007, 02:27 AM
thx for your reply, i set below in WebStart

<property name="com.imsl.license.path" value="http://servername/JMSL/license.dat"/>

the license can't be find, is that means that the path can't include http protocol?
when i put "c:\program files\vni\jmsl\license\license.dat", it works fine,

any suggestion?, thx!