Using Zeus with Java JDK

Find Tips and tricks on how to better use the Zeus IDE. Feel free to post your own tips but please do not post bug reports, feature requests or questions here.
Post Reply
jussij
Site Admin
Posts: 2523
Joined: Fri Aug 13, 2004 5:10 pm

Using Zeus with Java JDK

Post by jussij »

To do any Java development requires the installation of the Java SE Development Kit.

That JDK can be downloaded from here: https://www.oracle.com/java/technologies/downloads/#jdk18-windows

Choose the option that best suits your needs and in this case the x64 MSI Installer option was used.

1) Download and install the JDK using the details from the link above.

To test the installation was successful open a new command line prompt and type in the following command:

Code: Select all

java.exe --version
Running that command should result in the following output:

Code: Select all

c:\>java --version
java 18.0.1.1 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
2) Start the Zeus IDE.

3) Select the Templates Panel on the left, select the Java Document Type from the drop down list at the top, double click on the New File option and that will create the following Java code:

Code: Select all

class Application
{
    public static void main (String args[])
    {
        System.out.print("Hello World\n");
    }
}
4) Save that code to the Application.java file.

5) Use the Zeus Compiler, Compile menu to compile this Application.java file.

NOTE: Running the Java compiler on this source file creates a corresponding Application.class file where the base names of both files will match. So if a different source file name is used then a different class file will be produced.

6) With the Application.java file selected as the current active document, use the Zeus Macros, Execute 'Application.class' menu to run the Application.class file.
Using this command should result in the following output:

Code: Select all

Hello World
7) An alternative option for running the class file is to create a new Zeus tool item. To configure a new tool do the following:

a) Use the Options, Document Type menu to edit the Java Document Type.

b) Select the Tools section and define the following tool:

Code: Select all

  Program Type: Executable
     Menu Text: Execute '$fb' Class
  Program Name: java.exe
     Arguments: -cp . $fb
Work Directory: $fdd
    Run hidden: [x]
Then hit the Add button to add the new tool.

Note: The -cp . value used in the arguments field adds the current folder to the class path.

For more details on the classpath refer to this link: http://docs.oracle.com/javase/7/docs/te ... spath.html

Without this option running the tool will result in this Java runtime error:
Error: Could not find or load main class Application
c) To run the Application.java file make sure that file active and select the newly created tool from the Tools panel on the left or from the Tools menu.

Running the tool will result in the following output:

Code: Select all

Hello World
Setting up the Language Server
To setup the Java language server follow the instructions found here: https://www.zeusedit.com/lsp/java.html


Last bumped by jussij on Tue May 03, 2022 3:42 am.
Post Reply