PDA

View Full Version : verify license when link JMSL



Arthur
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?

ex:
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~

brian
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">
<information>
<title>WebStart Test</title>
<vendor>Visual Numerics, Inc.</vendor>
<description>WebStart Test</description>
<homepage href="../index.html"/>
<offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.4+"/>
<jar href="areaex.jar" main="true"/>
<jar href="jmsl.jar"/>
<property name="com.imsl.license.path" value="@server"/>
</resources>
<application-desc main-class="AreaEx"/>
</jnlp>


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);
else{
System.setProperty("com.imsl.license.path", location);
new AreaEx().show();
}
}


I hope this helps.

Regards,

brian

Arthur
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!