ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows functions / Java functions
  • Call function JavaLoad
  • Java version 1.2 (or sub-version), 1.3 (or sub-version), 1.4 (or sub-version), Java 6
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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
// Indique l'emplacement des fichiers .class de l'application Java à lancer
// Note : Indiquez les noms de dossiers/répertoires et les noms de .jar ou de .zip
// (et non seulement le nom des .class)
JavaLoad("D:\sources\Exemple\TestJava")
// Définit la variable java.library.path à la valeur c:\tmp
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.
    Warning: do not enter the full path of a .class file, only the path of the directory containing 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

Call function JavaLoad

A single call to JavaLoad must be performed in a WINDEV application or in a WEBDEV website.

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.
Note To find the JVM.DLL file in Windows and the "libjvm.soc" file in Linux, proceed as follows:
  1. In Windows, search on the registry keys:
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JRE: "CurrentVersion" value, then "RuntimeLib" value in subkey <version>.
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment: value "CurrentVersion", then value "RuntimeLib" in subkey <version>.
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\JDK:: value "CurrentVersion", then value "RuntimeLib" in subkey <version>.
    • HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit: value "CurrentVersion", then value "RuntimeLib" in subkey <version>.
  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: wd300jav.dll
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help