Creating and editing Java source files

You can create and edit Java™ source files in a number of ways: using IBM® i Access for Windows, on a workstation, with EDTF, and with SEU.

With IBM i Access for Windows

Java source files are American Standard Code for Information Interchange (ASCII) text files in the integrated file system.

You can create and edit a Java source file with IBM i Access for Windows and a workstation-based editor.

On a workstation

You can create a Java source file on a workstation. Then, transfer the file to the integrated file system by using file transfer protocol (FTP).

To create and edit Java source files on a workstation:

  1. Create the ASCII file on the workstation by using the editor of your choice.
  2. Connect to your server with FTP.
  3. Transfer the source file to your directory in the integrated file system as a binary file, so that the file remains in ASCII format.

With EDTF

You can edit files from any file system using the Edit File (EDTF) CL command. It is an editor that is similar to the Source Entry Utility (SEU) for editing stream files or database files. See the Edit File (EDTF) CL command for information.

If you use the EDTF command to create a new stream file, the file will tagged with an extended binary-coded decimal interchange code (EBCDIC) coded character set identifier (CCSID). Java files need to be tagged with an ASCII CCSID. You can use the Qshell utility touch to create an empty stream file with the an ASCII CCSID and then use the EDTF command to edit the file. For example, to create an empty stream file /tmp/Test.java with an ASCII CCSID of 819, use the following command:
QSH CMD('touch -C 819 /tmp/Test.java') 

With Source Entry Utility

You can create a Java source file as a text file by using source entry utility (SEU).

To create a Java source file as a text file by using SEU, perform the following steps:

  1. Create a source file member by using SEU.
  2. Use the Copy To Stream File (CPYTOSTMF) command to copy the source file member to an integrated file system stream file, while converting the data to ASCII.

If you need to make changes to the source code, change the database member by using SEU and copy the file again.

For information about storing files, see Java-related files in the IFS.