ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Java functions
  • Calling the JavaLoad function
  • Java version 1.2 (or sub-version), 1.3 (or sub-version), 1.4 (or sub-version), Java 6
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
JavaLoad (Function)
In french: JavaCharge
Specifies the location of user classes required to run the Java application or the Java applet.
Example
// Specifies the location of .class files of the Java application to start
// Note: Specify the names of folders/directories and the names of .jar or .zip
// (and not just the name of .class)
JavaLoad("D:\sources\Example\JavaTest")
// Defines the java.library.path variable to the c:\tmp value
JavaLoad(".", "-Djava.library.path=c:\tmp")
Syntax
<Result> = JavaLoad(<Location> [, <Parameters>])
<Result>: Boolean
  • True if the specified paths exist,
  • False otherwise.
<Location>: Character string
List of locations separated by:
  • semicolons (";") in Windows,
  • colons (":") in Linux.
The locations can correspond to:
  • Full or relative path of .jar files,
  • Full or relative path of directories containing the .class files.
    Caution: don't specify the full path of a .class file but only the path of directory that contains it.
<Parameters>: Optional character string
Options for initializing the Java library. These strings must have the following format:
"-D<Name>=<Value>"

If several options must be specified, the corresponding strings must be separated by a comma.
Remarks

Calling the JavaLoad function

A single call to JavaLoad must be performed in a WINDEV application or in a WEBDEV site.
Java JavaLoad can be called as many times as necessary.

Java version 1.2 (or sub-version), 1.3 (or sub-version), 1.4 (or sub-version), Java 6

  • To use JavaLoad, the JAVA runtime environment (J2SE JRE) or the development environment (J2SE SDK) must be installed on the computer.
  • The error message "Failure loading JVM.DLL" means that the JAVA.DLL file was not found on the current computer. The directory containing the JVM.DLL file must be added to the PATH variable of current computer.
Remark: the search for JVM.DLL file in Windows and for "libjvm.soc" file in Linux is performed as follows:
  1. In Windows, search on the registry keys:
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE: "CurrentVersion" value, then "RuntimeLib" value in <version> subkey.
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment: "CurrentVersion" value, then "RuntimeLib" value in <version> subkey.
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK:: "CurrentVersion" value, then "RuntimeLib" value in <version> subkey.
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit: "CurrentVersion" value, then "RuntimeLib" value in <version> subkey.
  2. For all platforms (Windows and Linux), search from the directory given by the "JAVA_HOME" environment variable.
  3. For Linux, search in the "/etc/alternative/jre" directory.
  4. For all platforms (Windows and Linux), search in PATH for finding libraries of operating system.
Related Examples:
WD JAVA Calls Training (WINDEV): WD JAVA Calls
[ + ] WD JAVA Calls is an example containing two configurations of project:
- A "Windows Application" configuration that is used to create the executable of the application
- A "Java Application" configuration that is used to create the Java archive (.JAR) of the application
This example is supplied with a JAR archive named "JavaFunction" external to the application.
It presents the call to the methods of classes of this JAR archive via the WLanguage function named JavaExecuteFunction.
This example also explains how a memory table can be filled (identical in Java mode and in Windows mode)
Component: wd290jav.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 07/04/2023

Send a report | Local help