From: Julian R. <jro...@gm...> - 2021-07-11 02:01:25
|
The instructions at http://czt.sourceforge.net/dev/setup.html describe how to download and build the CZT standalone. But the CZT sources retrieved by 'git clone git://git.code.sf.net/p/czt/code' do not successfully build with JDK11. The fixes given here enable you to build the standalone CZT using JDK11 and the latest Maven 3.8.1. HowTo: 1/ If you don't have the sources, follow the above instructions to 'git clone git://git.code.sf.net/p/czt/code'. 2/ Replace the files by those in the zip file at ' https://drive.google.com/file/d/1NMFsEIM03Q4JvDweuWHotzEVURFLo-T-/view?usp=sharing '. 3/ Follow the above instructions to build in the top level ./code directory. For example 'cd ./code/' 'mvn -X -l logfile clean install'. (That's minus-ell to name the logfile output.) The build does take some time, around 20-30 minutes on my modest laptop. 3.1/ The resulting czt.jar will be located in ./code/lib/ 3.2/ If the build fails then you can view 'logfile' in ./code/ using a text editor. Go to the end and scroll upwards to find the [ERROR] reason. If some goal failed to execute but there doesn't seem to be a compilation error then you may have suffered an Internet brownout (Maven downloads files into ~/.m2/repository during the build) and you can just retry the build once more. Size: The downloadable czt.jar at czt.sourceforge.net is 6148KB in size (as per my Windows file system). Whereas the JDK11-buildable file size is 7400KB. The differences are attributable to inclusion of JAXB libraries in the new jar (javax/ and com/sun/ packages). Summary of changes: The changes are the minimum required to various Maven configuration files (pom.xml) and to Gnast sources. There are no changes to Java code (excepting Gnast). All the changes are commented with 'jhr' to make them obvious. The changes to pom files are a/ to do with goal-setting, and b/ bringing in JAXB as a dependancy. (JAXB was bundled with JDK8 but has since been un-bundled. The CZT source code could be updated to use the newer 'jakarta' api.) The change to Gnast works well but is a workaround. Some behaviour in Velocity (which gnast basically wraps up), or perhaps in some maven plugin used by Velocity, has changed such that resource files in the templateDirectory are not processed as they must previously have been. (A fix to Velocity / plug-in might be investigated as an alternative solution.) The following 'git status' output shows which files are modified: On branch master Your branch is up to date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: corejava/corejava-circus/pom.xml modified: corejava/corejava-circusconf/pom.xml modified: corejava/corejava-circuspatt/pom.xml modified: corejava/corejava-circustime/pom.xml modified: corejava/corejava-oz/pom.xml modified: corejava/corejava-z/pom.xml modified: corejava/corejava-zeves/pom.xml modified: corejava/corejava-zpatt/pom.xml modified: corejava/pom.xml modified: dev/gnast/src/main/java/net/sourceforge/czt/gnast/Apgen.java modified: dev/gnast/src/main/java/net/sourceforge/czt/gnast/Gnast.java modified: dev/gnast/src/main/java/net/sourceforge/czt/gnast/Project.java modified: parser/parser-circus/pom.xml modified: parser/parser-circusconf/pom.xml modified: parser/parser-circustime/pom.xml modified: parser/parser-oz/pom.xml modified: parser/parser-ozpatt/pom.xml modified: parser/parser-z/pom.xml modified: parser/parser-zeves/pom.xml modified: parser/parser-zpatt/pom.xml modified: parser/pom.xml modified: pom.xml The changes have been used to build on a Windows 10 laptop on which cygwin is installed, so maybe some path separator errors are present in my changes. Further tests would be useful: 1. Build on a Windows laptop that does not have cygwin installed 2. Build on a *nix (Linux) host 3. Try building with the latest JDK16 julian rose |