ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing in Java
  • Overview
  • Generating a standard Java archive
  • Generating an application for Java Web Start
  • To generate an application for Java Web Start:
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
Overview
When your Java application is developed, you can create a Java archive that can be run directly. In this case, there are several solutions:
To start creating a Java archive:
  • Display the Java project configuration in the editor.
  • On the "Project" tab, in the "Generation" group, click "Generate".
Remark: The current project configuration must correspond to the Java project configuration that will be generated.
Remark: To compile (in Java) a Java project created with WINDEV, a Java Development Kit must be installed on the development computer (OpenJDK, for example).
Generating a standard Java archive
A standard Java archive allows you to start the application by double-clicking the generated .jar file. A .bat file is also generated if the double click does not operate.
To create the Java archive:
  1. Start the wizard for creating the Java archive:
    • Display the Java project configuration in the editor.
    • On the "Project" tab, in the "Generation" group, click "Generate".
  2. Select "Generate a standard Java application". Go to the next step.
  3. Enter the name of the archive and the information found in the manifest (Company, Description and Copyright). Go to the next step.
  4. Specify the version number of Java executable. Two formats are available for the version numbers:
    • Standard format. This format is the standard format managed by Windows. This format corresponds to a set of 4 numbers separated by dots.
      • The first group of 4 digits corresponds to the number of major changes performed in the application.
      • The second group of 4 digits corresponds to the number of minor changes performed in the application.
      • The third group of 4 digits corresponds to the generation number.
        We advise you to automatically increment this number at each generation. This increment operation is automatically performed if the option "Automatically increment the version at each generation" is checked.
      • The last group of 4 digits corresponds to the number of reviews (branches in the SCM for example).
    • Format for compatibility. This format was used until version 12 by default.
      Remark: All the characters (digits and letters) are allowed. For example: "1.01A".
      If the option "Automatically increment the version at each generation" is checked:
      • the version number "1.01A" will become "1.01B".
      • the version number "A14Z" will become "A15A".
  5. Specify whether the WINDEV framework for Java must be included in the .jar archive. Go to the next step.
  6. Specify the other files that must be included in the ".jar" archive. You can select the JDBC drivers used to access a database for example. Go to the next step.
  7. Specify:
    • the command of the Java compiler to use. To customize this parameter (if several compilers are installed on the computer for example), select "Custom". In this screen, you can also specify the command line that will be used (for more details, see the documentation about the compiler).
    • the command for creating the archive. The "Custom" option allows you to define the tool that will be used to create the archive. You can also specify the command line that will be used (for more details, see the documentation of the compiler) and the content of archive manifest.
    • the command for including other archives. The "Custom" option allows you to define the tool that will be used to extract the archive as well as its command line.
  8. The ".jar" archive is created.
The corresponding file was created in a subdirectory corresponding to the Java project configuration (subdirectory of EXE directory of project).
To open a file explorer on this directory, on the "Home" tab, in the "General" group, expand and select "Open generation directory".
The execution of Java archive is started by using the jvm of jdk used for the compilation.
You will also find a ".BAT" file in the generation directory of the Java archive. This file contains the command line required to start the application and it can be run in a Windows environment.
Remark: several jvm can be installed on the same computer (32-bit and 64-bit JVM for instance) while the explorer associates the .jar files with another jvm. In this case, running the archive by double-clicking the .jar file may present some differences.
For the other environments, you must create a file used to start the ".jar" file.
For Linux, you can create a ".sh" file containing the following command line:
"java -jar MyProject.jar"
"MyProject.jar" corresponds to the ".jar" archive generated from your project.
Remark: For more details, see Java and database
Generating an application for Java Web Start
The Java application is deployed on a Web server and it is started from a browser on client computers. However, it is run like any standard application.
When the application is updated on the Web server, it is also updated on client computers.
This generation option simplifies the deployment and the update of a Java application.

To generate an application for Java Web Start:

  1. Start the wizard for creating the Java archive:
    • Display the Java project configuration in the editor.
    • On the "Project" tab, in the "Generation" group, click "Generate".
  2. Select "Generate an application for Java Web Start". Go to the next step.
  3. Enter the name of the archive and the information found in the manifest (Company, Description and Copyright). Go to the next step.
  4. Specify the version number of Java executable. Two formats are available for the version numbers:
    • Standard format. This format is the standard format managed by Windows. This format corresponds to a set of 4 numbers separated by dots.
      • The first group of 4 digits corresponds to the number of major changes performed in the application.
      • The second group of 4 digits corresponds to the number of minor changes performed in the application.
      • The third group of 4 digits corresponds to the generation number.
        We advise you to automatically increment this number at each generation. This increment operation is automatically performed if the option "Automatically increment the version at each generation" is checked.
      • The last group of 4 digits corresponds to the number of reviews (branches in the SCM for example).
    • Format for compatibility. This format was used until version 12 by default.
      Remark: All the characters (digits and letters) are allowed. For example: "1.01A".
      If the option "Automatically increment the version at each generation" is checked:
      • the version number "1.01A" will become "1.01B".
      • the version number "A14Z" will become "A15A".
  5. Specify the other files that must be included in the ".jar" archive. You can select the JDBC drivers used to access a database for example. Go to the next step.
  6. Define the signature parameters of the Java archive.
    • File of keys.
    • Associated password.
    • Name of key in the file.
    • Password of key.
  7. Define the parameters for deploying the Java Web Start application:
    • Deployment URL.
    • Directory corresponding to the URL.
  8. Specify:
    • the command of the Java compiler to use. To customize this parameter (if several compilers are installed on the computer for example), select "Custom". In this screen, you can also specify the command line that will be used (for more details, see the documentation about the compiler).
    • the command for creating the archive. The "Custom" option allows you to define the tool that will be used to create the archive. You can also specify the command line that will be used (for more details, see the documentation of the compiler) and the content of archive manifest.
    • the command for including other archives. The "Custom" option allows you to define the tool that will be used to extract the archive as well as its command line.
    • the command for generating the archive file. The "Custom" option allows you to define the tools that will be used to generate the file of keys.
    • the command for signing the archive. The "Custom" option allows you to define the tool that will be used to sign the archive as well as its command line.
  9. The creation of the Java applet is completed.
The corresponding file was created in a subdirectory corresponding to the Java project configuration (subdirectory of EXE directory of project).
To open a file explorer on this directory, on the "Home" tab, in the "General" group, expand and select "Open generation directory".
To run the test of this applet, start the HTML page for test. This page is used to install the client Java application.
Remark: For more details, see Java and database.
Minimum version required
  • Version 9
Comments
Click [Add] to post a comment

Last update: 11/22/2022

Send a report | Local help