JavaVM:
GetJavaClasspath method
Description
Gets the classpath of the current Java VM.
Syntax
1 |
javavm<span></span>.getJavaClasspath( ) |
Return Values
String
Examples
This example shows how to use GetJavaClasspath to
get the classpath when the JVM is started and write it to a log
file:
1 |
// instance variables:<br>// JavaVM i_jvm<br>// boolean i_jvm_started = false<br>// string is_classes<br> <br>//Start JavaVM and Prepare to Connect to EJB server<br>string classpath<br>Integer li_ret<br> <br>//create JAVAVM<br>if ib_jvm_started = false then<br>   i_jvm = create javavm<br> <br>  classpath = is_classes<br>  li_ret = i_jvm.createJavaVM(classpath, true)<br>  if li_ret = -1 then<br>    MessageBox("Error", "Failed to load JavaVM")<br>  end if<br>  if li_ret = -2 then<br>    MessageBox("Error", "Failed to load EJBLocator")<br>  end if<br> <br>  ib_jvm_started = true<br> <br>  integer li_FileNum<br>  string ls_classpath, ls_string<br> <br>  li_FileNum = FileOpen("C: empclasspath.log", &<br>     LineMode!, Write!, LockWrite!, Append!)<br>  ls_classpath = i_jvm.<span>getjavaclasspath</span>()<br>  ls_string = String(Today()) + " " + String(Now())<br>  ls_string += ": ~r~n" + ls_classpath + "~r~n"<br>  <br>  FileWrite(li_FileNum, ls_string)<br>  FileClose(li_filenum)<br>end if |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments