💡Tips / FAQ
GraalVM Native Image Support
The Java Utility Package supports the creation of GraalVM native executables by including the necessary Java reflection definitions within the JAR file.
Prerequisites
macOS: Xcode
Windows: Visual Studio Build Tools 2022 or later
Compile / Create Executable
JShell
For a quick test of any ch.k43.util function, utilize the interactive JShell command included in the JDK. Ensure the ch.k43.util JAR file is either located in the current directory or accessible via the directory specified in the class-path argument.
See the Java Shell User Guide on how to use JShell
FAQ
Q: Which are the design goals of this Java package ch.k43.util?
Ease of use: The classes and methods must be flexible and simple to use.
No UI calls: Do everything without user interface to allow this toolkit to be used for background tasks or server processes.
Fast: Write the code as performant as possible.
Favor memory usage over I/O: In today's world, memory is no longer a limiting factor. Therefore, many operations can be done in memory where (temporary) files were used in the past (e.g. KDB creates a data structure from SQL SELECT, KFile operations are mostly in memory).
Use extensive logging: The KLog.debug() and KLog.error() functions are used throughout the code to help debugging your code. Also use the toString() methods found in each class to show the internal field values of the objects during development.
Platform independence: Write everything platform independent.
Minimize prerequisites: Stay with the Java SE standard libraries. Use only external JAR files when absolutely necessary (e.g. KSMTPMailer, JDBC drivers).
Q: How many lines of Java code are in this package?
Last updated