Open mboursnell opened 1 year ago
The Nashorn JavaScript Engine has been removed from recent versions of Java, which breaks CollateX. You will need JDK8 for Mac M1, which you can find here: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk#zulu (bottom of the page).
OK, thanks. I installed JDK8 (see image attached), but it doesn't seem to have helped...
Mike@MIKEs-M1-iMac collateX % java --version java 16.0.1 2021-04-20 Java(TM) SE Runtime Environment (build 16.0.1+9-24) Java HotSpot(TM) 64-Bit Server VM (build 16.0.1+9-24, mixed mode, sharing) Mike@MIKEs-M1-iMac collateX % Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar song_trees_55_files.json Unexpected error null Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar song_trees_55_files.json A B Error while parsing command line arguments (-h for usage instructions) Invalid resource: A Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar (song_trees_55_files.json A B) zsh: unknown group Mike@MIKEs-M1-iMac collateX %
You are half way there. It's still calling on the previously installed version of Java (16), instead of 8. Follow the "Set JAVA_HOME environment variable" instructions listed in this guide, https://dev.to/shane/configure-m1-mac-to-use-jdk8-with-maven-4b4g That should fix the problem.
If you want more background information on setting your JAVA_HOME variable, see here: https://stackoverflow.com/questions/21964709/how-to-set-or-change-the-default-java-jdk-version-on-macos
That works! Thanks.
How do you select two of the four witnesses? I tried various things... What is the syntax?
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar witnesses.json
{"witnesses":["A","B","C","D"],"table":[[["A "],["A "],["A "],["A "]],[["black "],["black "],["striped "],["striped "]],[["cat ","in ","a "],["cat ","in ","a "],["cat ","in ","a "],["cat ","in ","a "]],[["black "],["black "],["black "],["white "]],[["basket"],["basket"],["basket"],["basket"]]]}%
Mike@MIKEs-M1-iMac collateX %
Mike@MIKEs-M1-iMac collateX %
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar witnesses.json A B
Error while parsing command line arguments (-h for usage instructions)
Invalid resource: A
Mike@MIKEs-M1-iMac collateX %
Glad to hear that it worked. As far as I remember there is no witness selection syntax. You can either pre filter the input before sending it to CollateX or post process the output. The idea is that the JSON is already a derivative of some other input file or files, like plain text, XML or a database.
OK, thanks. That'll be fine. I can work with that. Looking forward to trying it...
But the help suggests that you can (or have I misread it? I'm not sure what "|" and "(" mean)
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar -h
usage: collatex [
What I think is meant is that you can either supply a single JSON file that supplies all the witnesses or a list of file names of plain text files. As in java -jar collatex-tools-1.7.1.jar plain_text_witness1.txt witness2.txt witness3.txt
Ah! I see. Thanks. Thanks for all your help. I'll try using it now.
Hi,
I am struggling to get collatex to work with the example json file. Can you help?
This is what I get (below)
Thanks,
Mike
Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar witnesses.json
Unexpected error null Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar witnesses.json A B Error while parsing command line arguments (-h for usage instructions) Invalid resource: A Mike@MIKEs-M1-iMac collateX % java -jar collatex-tools-1.7.1.jar (witnesses.json A B) zsh: unknown file attribute: i Mike@MIKEs-M1-iMac collateX %
Mike@MIKEs-M1-iMac collateX % more witnesses.json { "witnesses" : [ { "id" : "A", "content" : "A black cat in a black basket" }, { "id" : "B", "content" : "A black cat in a black basket" }, { "id" : "C", "content" : "A striped cat in a black basket" }, { "id" : "D", "content" : "A striped cat in a white basket" } ] } witnesses.json (END)