Help
Content
Requirements
The editor requires Java 8 or higher. To compile Java code by the built-in compile function, Eadgyth must be run with the runtime environment (JRE) contained in a Java Development Kit (JDK).
It is further important that the built-in commands to run C#, Python, and R assume that the paths to the executables are set as PATH system (environment) variables. For the C# project category, the editor assumes a .NET SDK installation.
Running code (and comiling) using the built-in function prefers or requires UTF-8 encoded files for reliable output (as of vs1.2.1). The editor can open files with legacy encodings using a non-UTF-8 system encoding as fallback if the system encoding is not UTF-8. A fallback may also be selected in the File menu before opening a file with a legacy encoding. A file can be converted to UTF-8 and also be reverted to the original encoding as long as it remains open in File menu.
Setup to run source code
Setting a project
- Open a file from or save a new file to the directory that is the intended root directory of the project. The project directory is the working directory where commands (built-in or custom) will be executed.
- Open the project settings by selecting 'Settings for...' in the 'Project' menu and choose the category to open the project settings.
- The input options depend on the project category. Initially, the required entry is the name of the project directory where the project will be created.
Retrieving projects
- The project that was active when the Editor has been closed the last time is re-loaded and set active if a file of the project is opened (or a new file is saved to the project directory).
- To retrieve a previous project independently of the project that had been active lastly "Save ProjConfig file in the project to retrieve settings" can be selected in the project settings. This stores the parameters for the project in the project directory and marks it as an "Eadgyth project". Unselecting the option deletes the ProjConfig file.
Switching between projects
- Multiple projects can be created within a session.
- Selecting a file that belongs to a project other than the currently active one will disable running (or compiling, where applicable) that project. Use 'Change Project' in the Project menu to switch to the project that the selected file belongs to.
- The editor may prompt you to switch projects (e.g., when opening a file belonging to a project defined in a 'ProjConfig.properties' file).
Saving changed in project files
The label or tooltip 'Save and run' (or 'Save and compile', where applicable) means that all open files of an active project but no other open files are saved before execution. If 'Save' is not indicated, no file is saved.
Project categories
Java
- Compile and Run: To run a Java program, first compile the source file(s) by selecting 'Save and compile'. If the compilation was successful the Java program can be started by selecting 'Run'.
- Modular program: A Java program can be run on the module path (for Java 9 or higher). To activate "module mode", specify the name of the (main) module in the "Source" tab of the project settings. Leaving the module name blank will use the classpath. The editor can handle the following simple program structures: A
module-info.javafile is saved directly in the source directory (for single-module mode), ormodule-info.javafiles are stored in direct subdirectories of the source directory (for multi-module mode). In the latter case, the specified main module name must exactly match the name of the module's subdirectory. - Output directory: A destination directory name for compiled class files can be specified in the 'Compile/build' tab in the project settings (like 'bin', or, for single-module mode also 'bin/my.module'). This directory is created in the project directory on compilation. Unlike other non-empty folders, this directory can be deleted in the editor's Project Explorer to allow recompilation from scratch.
- Building a JAR: An executable JAR is created by selecting 'Create executable jar' in the 'Project' menu. A name for the JAR file can be specified in the 'Compile/build' tab in the project settings. If no name is entered, the name of the project directory is used. The JAR is saved in the project directory (unless a path is specified to save it to another location). For modular programs, the creation of a JAR is not yet supported.
- Including non-Java Files: To include files other than Java files in a compilation (or JAR), the file extensions are specified including the leading dot in the field 'Extensions of included non-Java files' in the 'Compile/build tab'.
- Usage of Libraries: Libraries may be specified in the tab 'Libraries' (Java 8), or in the tabs 'Libraries (classpath)' and 'Libraries (module path)' (Java 9 or higher) in the project settings. Libraries can be given with absolute paths or with paths relative to the project directory (e.g. 'libs/some.jar'). If a Libarary is added via browsing, the path is initially absolute and can be made relative using the 'Rel.'-button, provided the library is located within the project directory.
Java source-file mode
- Select "Save and run" to run the Java program whose name is entered in the project settings.
- Java "source-file mode" allows running a Java program without the compilation step as described in the Java specification, introduced in Java 11 and extended in Java 22: Prior to Java 22, the program must consist of a single Java file. Since Java 22, multiple source files as well as a modular program in single-module mode are allowed.
- The editor enables selecting source-file mode if it is run with Java 11 or higher. Attempting to run a program with more than one source file on Java prior to 22 would result in compilation errors because the editor itself does not check if multiple files are used on Java below 22. However, the editor runs a program on the module path if a
module-info.javafile is found in the source root and the Java version is 22 or higher.
C#
- Compile and Run: First note that 'compile' means compiling sources and building an assembly. Therefore, 'Save and compile' is selected to create a DLL. If the compilation was successful, the program can be started by selecting 'Run'.
- Output name: The name of the output file(s) initially corresponds to the name of the project directory. An alternative output name can be specified in the field 'Name for output file' in the 'Compile/build' tab. The currently set output file is the that is run if 'Run' is selected.
- Output directory: The editor creates the output directory 'bin' in the project directory. Output files are created directly in this directory (without 'debug' or 'target version' subdirectories). As discribed for Java, the output directory can be deleted in the editor's Project Explorer to allow a new compilation from scratch.
- .csproj: The editor generates a new minimal .csproj file for a new project. Its name corresponds to the output name defined above. The .csproj file will not be overwritten on subsequent compilations to preserve any manual changes. Accordingly, any pre-existing .csproj with the same name will not be overwritten. However, the .csproj will be regenerated if it is deleted. Likewise, a new .csproj file will be created if the output name is changed, or differs from any pre-existing .csproj.
- Specifying the output type: The output types, 'Library' or 'WinExe', can be specified in the 'Compile/build' tab in the project settings. The default is 'Exe'. The output type is only automatically added to .csproj when a new .csproj file is generated.
Python
- A Python script is started by selecting 'Save and run'. The script is run by the
python [script_name.py]command and uses the-ucommand-line option to disable output buffering.
R
- An R script is started by selecting 'Save and run'. The script is run by the
Rscript [scriptname.R]command.
HTML
- An HTML (or HTM) file in the project directory is viewed in the default browser by selecting 'Save and run'.
- The file that is viewed is the one in the selected tab.
Custom commands
- Enter system commands in 'Commands' tab. The 'Compile', 'Run', and/or 'Build' actions are enabled when the corresponding fields are filled.
- Please also note the remarks about using a system command in the Console section below.
Console
The console shows messages after compiling a project (applies to Java and C#) and the standard and error output of a tested program. A started program can be terminated by pressing the 'stop' button in the console's toolbar.
The console is interactive while a process is running. Any input a program requests can be typed in the console area.
Additionally, a custom system command can be run by pressing the 'Enter and run a system command' button (pencil icon) in the console toolbar.
Note the following editor-specific behavior/limitations:
- The 'stop'-button only ends the process started by the command. Any sub-processes started from within that process are not affected.
- The command is internally split into arguments at each space. Arguments containing spaces can be grouped by wrapping them in quotes. This parsing is handled by the editor itself, not by a shell, but should behave as expected in most cases.
- The editor reads process in- and output as UTF-8. It may be necessary to add flags or switches to enforce UTF-8 encoding if the system's or JVM's default encoding is not UTF-8.
- The console may appear frozen in cases where a process buffers its output because the standard output is redirected to the editor's console. This may be solved by adding a command option that disables buffering (like -u for Python, see above), if available. If a process does not exit on its own due to the redirected output, a method to explicitly terminate it can be a temporary workaround (like
process.exit()for Node.js). Alternatively, a progam can be started by launching the native terminal from within Eadgyth. On Windows, this can be done withcmd /c start cmd /k [MyProgram]; on Linux/macOS the equivalent command depends on the installed terminal emulator (e.g.gnome-terminal -- bash -c '[MyProgram]; exec bash').
Contact: m.bussiek@web.de
(A message is welcome if the program does not work as suggested in this help)