Installing Wazi for VS Code

Prerequisites

Review the IBM Z Open Editor License Agreement and Third Party Notices before downloading.

Prerequisites for the installation:

  • Visual Studio Code version 1.81.0 or later: IBM Z Open Editor is delivered as an extension to VS Code instead of a stand-alone editor, so you must install and configure VS Code first. We recommend always using the latest version of VS Code available, however, the minimum version required is now 1.53; it was 1.44.0 in Z Open Editor v1. If you do not have VS Code installed we recommend using the Visual Studio Code for Java Installer provided by Microsoft, because it automatically downloads and installs a Java SDK together with VS Code. (You can skip the next bullet about Java dependency if you use this option.) For information about installation and configuration of VS Code, refer to the documentation.

  • Java SDK or JRE version 11 or later - 64 bit: The language servers included in this extension are implemented in Java. Therefore, you need to install and configure a 64-bit Java SDK or Runtime in order to start the extension successfully. We recommend installing VS Code for Java as described above, but if you already have VS Code or want to install Java yourself, then you can choose from the following options:

    • We highly recommend using versions 11 or 17 of IBM's Semeru Runtime that can be downloaded here. IBM Semeru Runtimes enable developers to build and deploy Java applications that will start quickly and deliver great performance - all while using less memory. We use it ourselves for development.

    • Alternatively, you can use the LTS versions 11 or 17 of Oracle Java or the OpenJDK.

    • Newer versions of Java should also work, but have not been tested with Z Open Editor.

Various settings are provided to configure how the extension uses Java. See the Configuring Java section below for more details. Contact us if you run into any issues with a specific Java version.

  • (Recommended) Git: To use the features that involve Git, you must install Git and have it available in your system path so that VS Code can display it. On Macs, Git comes out of the box. On Linux, you can install Git with your distribution's package manager. On Windows, you can get Git from https://git-scm.com.

  • (Recommended) Zowe CLI 6.33.3 or later. To make use of Zowe to open and edit files directly from z/OS® MVS™ or z/OS UNIX System Services via command line, you need Zowe CLI and host components configured. For more information, see Setting up integrations to interact with z/OS. Once installed, you can access z/OS resources as documented in Interacting with z/OS.

Downloading IBM Wazi for VS Code

Download the client of Wazi for VS Code from Mainframe DEV according to Procedure for downloading installation packages from Mainframe DEV. Extract the downloaded <license>_Wazi_Developer_for_VSCode_<version>.zip on your machine.

If you want to check code signing signatures for the downloaded binary files, refer to the following procedure. Install OpenSSL if you have not done so.

  1. The <license>_Wazi_Developer_for_VSCode_<version>.zip you extracted above contains the .sig and .pem files that are used to verify the binary files.

  2. Check the certificate validity.

    1. To view the certificate details, issue the following command:

      $ openssl x509 -text -in wazi-certificate.pem -noout
    2. To view the public key details, issue the following command:

      $ openssl rsa -noout -text -inform PEM -in wazi-public.pem -pubin
    3. Compare the exponent of the public key and the certificate to see that the public key is indeed the one within the certificate. You can also use any other certificate viewer such as Mac OS Preview.

    4. To check the validity of IBM public certificate, issue the following command:

      $ openssl ocsp -no_nonce -issuer wazi-chain0.pem -cert wazi-certificate.pem -VAfile wazi-chain0.pem -text -url http://ocsp.digicert.com -respout ocsptest

      If the certificate is valid, the output is:

      Response verify OK
  3. Verify the downloaded binary files.

    To verify the files by using the signature and public key files, issue the following command:

    $ openssl dgst -sha256 -verify wazi-public.pem -signature ${binary-filename}.sig ${binary-filename}

    For example, to verify zopeneditor-1.0.0.vsix, issue:

    $ openssl dgst -sha256 -verify wazi-public.pem -signature zopeneditor-1.0.0.vsix.sig zopeneditor-1.0.0.vsix

    If the binary is verified successfully, the output is:

    Verified OK

Installing Zowe Explorer

IBM Z Open Editor requires the Zowe Explorer VS Code extension 1.19.0 or later (1.22.0 is recommended) as a prerequisite. When you install IBM Z Open Editor, it will automatically try to download Zowe Explorer from the VS Code Marketplace for you. If you are working offline, then first install the Zowe Explorer VSIX file Zowe.vscode-extension-for-zowe-<version>.vsix that you extracted from wazi-development-client-<version>.zip into your VS Code instance. You can follow the VS Code documentation to Install from a VSIX.

Installing IBM Z Open Editor

IBM Z Open Editor provides support for IBM enterprise languages. There are three ways to download and install IBM Z Open Editor.

If you are an IBM Developer for Z Enterprise Edition or IBM Wazi customer, or are entitled to support for Z Open Editor in any other way, we recommend you download from our Mainframe DEV Download site. This convenient zip file includes code signing signature files and all related software components such as the IBM Open Debug VS Code extension, the IBM RSE API Plugin for Zowe CLI and the IBM distribution of Zowe CLI (a support entitlement that is also available for purchase).

If you are planning to use or evaluate the non-warranty and unsupported version of IBM Z Open Editor then you can install it directly from the VS Code Marketplace or the Open VSX Registry. By default, VS Code checks for extension updates and installs them automatically. You can disable auto-update as described in Extension auto-update.

Important: Before you install IBM Z Open Editor, you need to have a full Java SDK installed and configured on your development machine. See the Prerequisites section above and the Configuring Java for IBM Z Open Editor section.

Note: Starting from IBM Wazi 1.1.0, the user build functionality is part of the IBM Z Open Editor VS Code extension. User build allows z/OS developers to run personal builds within IBM Wazi using the IBM Dependency Based Build (DBB) tool. Follow user build documentation to learn more.

Installing IBM Z Open Editor from the Open VSX Registry

If you already have or want to configure VS Code to use the alternative public or a private on-site Open VSX Registry, or if you are using a VS Code compatible editor such as VSCodium or Eclipse Theia that use it by default, then you can find and install IBM Z Open Editor and install it from there as well. See the Open VSX documentation for how to configure and use this registry instead.

Installing IBM Z Open Editor from a .vsix file

Install zopeneditor-<version>.vsix that you extracted from wazi-development-client-<version>.zip into your VS Code instance as follows:

  1. Click the Extensions icon on the activity bar in VS Code to open the Extensions view.

  2. Click the ... icon on the upper-right corner in the Extensions view to reveal a drop-down menu of more actions.

  3. In the drop-down menu that appears, click Install from VSIX....

  4. Use the file picker that pops up to navigate to and select the VSIX file you downloaded, and then click Install.

The extension should be installed from the VSIX file. For more information, see VS Code documentation to Install from a VSIX.

Installing IBM Z Open Editor from the VS Code marketplace

Alternatively, as IBM Z Open Editor is also available free of charge in the VS Code marketplace, you can get IBM Z Open Editor in either of the following ways:

  • Start VS Code, open the Extensions view by clicking the Extensions icon on the activity group or by clicking File > Preferences > Extensions, and then search for IBM Z Open Editor. Click Install and wait for the installation to finish.

  • Go to the VS Code marketplace website that hosts IBM Z Open Editor. Click Install and wait for the installation to finish.

Verifying the installation of IBM Z Open Editor

To quickly test whether IBM Z Open Editor is installed correctly, you can open a COBOL, PL/I, or HLASM program file on your machine. If you do not have such files on your machine, you can clone the sample repository as described in the Exploring the sample files section and open its COBOL, PL/I, or HLASM program files. If you see syntax highlighting on COBOL, PL/I, or HLASM code, the extension is working correctly.

Configuring Java

The COBOL, PL/I, and HLASM language servers utilized by IBM Z Open Editor were implemented using the Java programming language. Therefore, a Java Runtime is required to be available via settings or the program path to start in VS Code. The IBM Z Open Editor extension utilizes VS Code Settings properties, which can be added to VS Code user settings, to configure which and how Java should be used. These settings allow you to select the specific installation of Java to pick, in case you have several installations, as well as set parameters such as how much memory you want the extension to use.

Selecting the Java installation to use

Before starting a language server the language server clients in the IBM Z Open Editor VS Code extension try looking in different places to find a matching Java installation. They will look in the following places in this specific order and pick the first Java installation they can find that is at least version 11 and 64-bit. If it finds a Java that fails the test against these criteria it will continue searching:

  1. The zopeneditor.JAVA_HOME VS Code user setting.

  2. The java.home VS Code user setting.

  3. The JAVA_HOME environment variable.

  4. The PATH defined for the environment in which Z Open Editor runs (i.e. you default Windows or MacOS path).

  5. A typical platform-specific location. For example, on MacOS it will execute the /usr/libexec/java_home -V and on Windows the where java.exe commands to locate a valid Java installation.

As you can see user settings always take precedence over the other options listed, which enables you to specify a different Java version for IBM Z Open Editor than the default on your computer in case you have installed multiple version. If you used the recommended Visual Studio Code for Java Installer the java.home user setting was set by this installer. Also note that the methods at the end of the list require a significant amount of time as they are executing programs on your system. To improve startup times you should consider user settings as they provide the best startup performance.

If Java cannot be located, check the VS Code Output view's Z Open Editor tab for any error and try to fix the problem by either setting the JAVA_HOME environment variable or create an entry in your VS Code user settings.

To define a user setting use the Preferences > Settings menu and either locate the setting in the graphical editor under IBM Z Open Editor or edit the setting json file directly by adding an entry as follows using an absolute path name to the Java installation directory.

On Mac:

"zopeneditor.JAVA_HOME": "/Library/Java/JavaVirtualMachines/jdk11.0.15+10.jdk/Contents/Home"

On Windows:

"zopeneditor.JAVA_HOME": "C:\\Program Files\\Java\\jdk11.0.15+10"

Configuring the Java memory allocation

By default, the language server client that starts the individual language servers for COBOL, PL/I, HLASM, or REXX allocates a maximum of 512 MB of memory for each. The language servers will consume much less memory at startup, and then allocate and free memory when parsing programs. However, they might run out of memory when parsing very large program files and reach the predefined limit. To allow allocating more memory, use the following VS Code setting to specify a new maximum value:

"zopeneditor.server.memoryAllocation": 640

Keep in mind that this value is for each language you use, so when using both COBOL and PL/I, you might end up with a consumption of double the amount specified. If you are working with smaller programs or your computer might not support such a large amount of memory, you can also try values smaller than 512 with this setting.

Installing IBM Z Open Debug

You can use the IBM Z Open Debug VS Code extensions with z/OS Debugger to debug z/OS COBOL and PL/I applications in a remote VS Code client.

When you install v4, if Z Open Debug v3 was previously installed, also see Migrating from Z Open Debug v3 to v4 for the migration details.

Installing IBM Z Open Debug from a .vsix file

Install zopendebug-<version>.vsix that you extracted from wazi-development-client-<version>.zip into your VS Code instance. Check (#Installing IBM Z Open Editor from a .vsix file) for detailed steps.

Installing IBM Z Open Debug from the VS Code marketplace

Alternatively, as IBM Z Open Debug is also available in the VS Code marketplace, you can get IBM Z Open Debug in either of the following ways:

  • Start VS Code, open the Extensions view by clicking the Extensions icon on the activity group or by clicking File > Preferences > Extensions, and then search for IBM Z Open Debug. Click Install and wait for the installation to finish.

  • Go to the VS Code marketplace website that hosts IBM Z Open Debug. Click Install and wait for the installation to finish.

Verifying the installation of IBM Z Open Debug

To quickly test whether IBM Z OpenDebug is installed correctly, check whether the z/OS Debugger Profiles view is now available in Zowe Explorer.

Using IBM Z Open Editor in cloud-based editors

Z Open Editor can be installed and used with various cloud or browser-based editing environments that utilize VS Code as the editor. We list a couple of examples that we test with, but there might be more configurations that the editor would also work in.

Red Hat Dev Spaces for OpenShift

Our recommended cloud-based development environment is Red Hat OpenShift Dev Spaces that provides a cloud-based development environment that is fully integrated into Red Hat OpenShift. In fact, we have created a customized version of Dev Spaces for z/OS development called IBM Wazi for Dev Spaces that adds Z Open Editor, Z Open Debug as well as many additional zDevOps tools into one convenient solution package that can be easily deployed with an OpenShift operator and used with your z/OS LPARs as well as Wazi as a Service cloud-based z/OS server instances, or emulated Wazi Sandbox z/OS instances. Wazi for Dev Spaces is part of the IBM Z and Cloud Modernization Stack product offering.

To try Z Open Editor for free in Red Hat OpenShift Dev Spaces, you can sign up for a 30-day trial of the OpenShift Sandbox and Red Hat Developer Sandbox. We have a full tutorial for signing up and using Z Open Editor here.

You can also try Wazi for Dev Spaces as part of a Wazi as a Service trial as documented here. For this we also provide a detailed tutorial in our new IBM Redbook "Hybrid Cloud with IBM Z", Chapter 5.

GitPod

GitPod is a cloud-based IDE offering by the GitPod company that can also utilize VS Code as the browser-based editor and integrate with all the major Git service providers such as GitLab, GitHub, and Bitbucket. After you sign in with an account from either of these Git services, you can easily start a workspace with Z Open Editor.

To try it out with our code samples repository, use this link https://gitpod.io/#https://github.com/phaumer/zopeneditor-sample. The workspace will start up and load a custom image prepared by our team that even contains Zowe CLI and Ansible CLI. After the editor is up, you might have to click F1 and select the command View: Focus Activity Bar to bring in the sidebar that allows you to find our sample programs. Z Open Editor was automatically installed for this workspace, so you can just open a program and start editing. Note that this is a paid-for service, but the first hours are free.

GitHub Codespaces

Z Open Editor can also be used with all of its capabilities in Microsoft's GitHub Codespaces. After your start your development environment in Codespaces, you can find and install Z Open Editor from the integrated marketplace. You can also use extension recommendations.

Try it by using this link https://github.com/codespaces/new?machine=basicLinux32gb&repo=160883618&ref=wazi-main&location=WestUs2 that loads our Z Open Editor sample repository. After the editor is up, click Install in the dialog that asks "Do you want to install the recommended extensions for this repository?". Note that this is a paid-for service, but the first hours are free.

Pure web-based editing in vscode.dev and github.dev

Z Open Editor can be used as a pure web extension with limited capabilities when using Visual Studio Code in a browser, such as on vscode.dev or github.dev.

Try it by going to https://vscode.dev/github/IBM/zopeneditor-sample and confirming in the dialog to install the recommended extensions by clicking Install. No language server capabilities will be available, but syntax highlighting for all our supported languages.