IBM Z and LinuxONE - Software

Software

Software

In order to compete you have to be trusted. System software delivers high-performing system and database management, faster insights, secure cloud and agile DevOps, plus the reliability, flexibility and protection you expect from the mainframe.

 View Only

Java Development using IDz

By Chris Sayles posted Sun December 31, 2023 09:36 PM

  

Prerequisites

To take advantage of this feature, you need:

*The content in this tutorial was generated using IDz v15. There will be an updated version of this tutorial for IDz v16 coming in 2024.

Estimated time

Creating a simple Java program, running, debugging, and exporting to and MVS LPAR should take about 10 minutes.

In this example, we will be creating a Java Package, a simple Java program, running the program natively in IDz, debugging natively using IDz’s Debug capabilities, and exporting the source out to an MVS LPAR via Unix Systems Services.

Steps

Navigate to your installed IDz application, double click to open. Once open, IDz will prompt you for a workspace; specify the workspace and click Launch.


With IDz open, navigate to the Menu bar and choose: Window > Perspective > Open Perspective > OtherThis will cause a pop-up window to appear. This window is the Open Perspective wizard, which allows you to open different perspectives that are focused on different types of development tasks.

From the Open Perspective wizard, scroll down and choose Java.

This opens the Java perspective. This perspective opens and arranges views related to Java development. Remember: perspectives can be customized. If you or your shop use different Eclipse plugins for Java development, they can be installed in to IDz and then added to the Java perspective, allowing you to bring in tools you may need while taking advantage of the powerful built-in tooling for Java development in IDz.

With the Java Perspective open, navigate to the Package Explorer view in the upper-left corner, right-click inside the view and choose: New > Java Project.

Name the Java Project and click Finish.

Next, navigate to the newly created Java project, right-click and choose: New > Java Package.

Name the package, and click Finish. In this example, it has been named “helloWorldPackage”, ensuring the package name conforms to naming standards with a lowercase first letter. Additionally, the checkbox for Create package-info.java does not need to be checked.

Navigate back to the newly created package, right-click on it and choose New > Class.

Name the class and click Finish. In this example, the class has been named HelloWorld for case conformity, as Java Type casing starts with an uppercase.

This opens a new Java source member.

Next, code the Java program. In this example, a simple payroll calculator was used. Once finished coding, press Ctrl+S to save the program.

Navigate back to the Java program in the Package Explorer view, right-click on it and choose Run As > Java Application.

This will run the Java program and send the println output to the Console view, which will appear in the perspective.

Once finished, go to your Java source in the Editor view, navigate to the left side margin (next to the code), and double-click inside the margin to set breakpoints for debugging, which will occur in the next step.

With the breakpoints set, navigate back to the program in the Package Explorer view, right-click on it and choose Debug As > Java Application.


This brings up the Confirm Perspective Switch pop-up, which is a prompt that occurs when a debugging session is started and IDz needs to switch perspectives to allow the user to access debug functionality.

Debug the program as necessary. Note that the breakpoints set in the Editor view in a previous step persist and allow you to stop debugging on the targeted lines.

When finished debugging, return to the Java Perspective by clicking on the Java Perspective icon in the upper right corner of the workbench.

In the Java Perspective, navigate to the Package Explorer, find the Java Package containing the Java source created in previous steps, right-click on it and choose Export.

This brings up the Export Wizard popup. Inside the wizard, navigate to the Remote Systems folder and choose Remote JAR file, then click Next.

On the next panel, click the Browse button, change the Connection dropdown at the top to the MVS LPAR you are targeting, and choose My Home, give the JAR file a name in the Archive name input box, then click OK.

When returned to the previous panel, click Finish. If prompted to overwrite, choose yes.

Next, navigate to the Menu bar, go to the Window menu and choose Show View > Other.

From the Show View wizard popup, type Remote in the type filter text box at the top, then find Remote Systems in the results below. Click on Remote Systems and then Open.

With the Remote Systems view open, log in to your MVS LPAR, then navigate to z/OS UNIX files > My Home, and find the package that was exported.

Navigate back to the Package Explorer, find the Java source file, then drag and drop the file from the Package Explorer to the newly created Java package inside the UNIX directory on your MVS LPAR.

With this step completed, you have created a Java program and exported it to an MVS LPAR.

In this tutorial, you have accessed IDz’s built in Java tooling, created a simple Java program and its required peripherals, run the program, debugged the program using breakpoints in the logic, and exported the program to an MVS LPAR. To learn more about IDz usage, please visit the DevOps Distance Learning home page to find the schedule for our online, instructor-led classes. 

1 comment
27 views

Permalink

Comments

Fri January 12, 2024 12:00 PM

Great stuff, I get this question often as the IDz Product Mgr.  IDz does a wonderful job supporting the 'mainframe languages' and so much more!