Installing javacc on mac with terminal - macos

I have downloaded javacc-5.0 and tried to follow various different guides to no avail.
I unzipped the package, modified the PATH variable to contain ../javacc-5.0/bin/lib/javacc.jar directory and ensured that all the correct files are executable. However, a which javacc command gives no output and trying to run the javacc exec has also given the error Could not find or load main class javacc (the jar file is definitely there in the lib directory).

In the ...../javacc-5.0/bin directory, there should be a file called javacc that should looks something like this
#!/bin/sh
JAR="`dirname $0`/lib/javacc.jar"
case "`uname`" in
CYGWIN*) JAR="`cygpath --windows -- "$JAR"`" ;;
esac
java -classpath "$JAR" javacc "$#"
If so, edit your PATH variable to include /....../javacc-5.0/bin, i.e. the absolute path of that bin directory. There is no need for the PATH variable to include /....../javacc-5.0/bin/lib/javacc.jar; so take that out.
Start a new terminal. In the new terminal, check the PATH variable with echo $PATH. Try which javacc. Try javacc.

javacc can easily be installed using Homebrew:
brew install javacc
https://formulae.brew.sh/formula/javacc

Related

Installing Uppaal on Mac OS

I'm trying to install Uppaal on my Mac. I have Catalina installed and I am aware of the workaround posted on here to do with authorisation and have done this.
But when I run the Uppaal script I get an error saying
Error: Unable to access jarfile ./uppaal.jar
I can't figure out what the problem is or how to get around it. Java is up to date.
Help please, I need this for a uni assignment
It seems that UPPAAL will give the above error, if run it from the GUI from a path containing a space.
I will report this to the development team, until they are able to fix it one of the following workaround:
move the files to a path not containing any spaces (NB: the full path must not contain any spaces)
open the uppaal batch file(e.g. by TextEditor) and add this command to the top of it:
cd "$(dirname "$0")"
Just encountered the same issue. Instead of adding cd "$(dirname "$0")" to the uppaal bash script, which is a bit intrusive, I changed line:
HERE=$(dirname "$(readlink -e $0)")
to:
HERE=$(realpath -s "$(dirname "$0")")
This does not change the current directory at time of invocation. Instead it turns the (wrong) relative path of uppaal.jar to an absolute path.

Cygwin program compiled but not runnable

I just installed CD-HIT and followed these instructions:
Installation
Most CD-HIT programs were written in C++. Installing CD-HIT package is very simple:
download current CD-HIT at http://bioinformatics.org/cd-hit, for example cd-hit-2006-0215.tar.gz
unpack the file with ” tar xvf cd-hit-2006-0215.tar.gz --gunzip”
change dir by “cd cd-hit-2006”
compile the programs by “make”
you will have all cd-hit programs compiled
I followed these steps and indeed .exe files were made:
cdhit.c++ cdhit-est-2d.c++ clstr_select_rep.pl
cd-hit.exe cd-hit-est-2d.exe clstr_size_histogram.pl
cdhit.o cdhit-est-2d.o clstr_size_stat.pl
cdhit-2d.c++ cd-hit-para.pl clstr_sort_by.pl
cd-hit-2d.exe cdhit-utility.c++ clstr_sort_prot_by.pl
cdhit-2d.o cdhit-utility.h clstr_sql_tbl.pl
cd-hit-2d-para.pl cdhit-utility.o clstr_sql_tbl_sort.pl
cdhit-454.c++ ChangeLog clstr2tree.pl
cd-hit-454.exe clstr_cut.pl clstr2txt.pl
cdhit-454.o clstr_list.pl clstr2xml.pl
cd-hit-auxtools clstr_list_sort.pl doc
cdhit-common.c++ clstr_merge.pl FET.pl
cdhit-common.h clstr_merge_noorder.pl license.txt
cdhit-common.o clstr_quality_eval.pl make_multi_seq.pl
cdhit-div.c++ clstr_quality_eval_by_link.pl Makefile
cd-hit-div.exe clstr_reduce.pl plot_2d.pl
cdhit-div.o clstr_renumber.pl plot_len1.pl
cd-hit-div.pl clstr_rep.pl psi-cd-hit
cdhit-est.c++ clstr_reps_faa_rev.pl README
cd-hit-est.exe clstr_rev.pl usecases
cdhit-est.o clstr_select.pl
However when I typ: cd-hit-est in the cygwin command line, it will say: -bash: cd-hit.exe: command not found. I'm not able to figure out why this is happening. Even when I'm in the folder were the .exe files are located it still will give the same error.
When you try to run command without a path, bash tries to find the command name in each directory from the PATH environment variable.
Usually current directory "." is not in the PATH so you have to run command adding absolute or relative path before command name:
./cd-hit.exe
or
/absolute/path/to/your/cd-hit/program/cd-hit.exe
If you want to permanently run command cd-hit.exe from anywhere, just add the directory where cd-hit was compiled to any existing auto-loaded bash profile files:
.profile
.bashrc
.bash_profile
like
PATH=$PATH:/absolute/path/to/your/cd-hit/program
export PATH

bash: ngc: command not found

I'm using #angular/compiler-cli to build my ng2 app in aot mode. When I input 'ngc -p tsconfig-aot.json' in my bash window, I get 'bash: ngc: command not found'. However, when I use 'node_modules/.bin/ngc -p tsconfig-aot.json' instead, it works. I googled for serval times but didn't get any usfull information. Can any give me a hand? Thx!
Seems like you need to put ngc in your path:
echo $PATH
Do you see ngc in binary in your path?
If not:
PATH=$PATH:/path/to/ngc
To make it permanent add to .bash_profile
export PATH=$PATH:/path/to/ngc
I've tried to change the slash to 'backslash' on windows and it worked for me:
node_modules\\.bin\ngc
If you don't want to set it globally, you can specify an absolut path in your angular-project, just make sure that you delete this part of the path when you don't use it anymore.
ngc is in node_modules/.bin, so depending on where you want to use ngc you can export the path like this:
PATH=$PATH:../../../node_modules/.bin
To run commands located into the node_modules folder of your project, without installing them globally (operation that will make the ngc command work in any system folder), you can use this command:
ngx ncc <options>
Basically ngx is a shortcut that executes any command located in node_modules bin folder.

Mac OSx 7zcat command not found

I am trying to execute a Makefile script and my Mac complains about 7zcat, although I already have 7z installed.
/bin/sh: 7zcat: command not found
Any thoughts on what's missing on my system? Thank you!
I have never used 7zcat before.
However, it looks like it needs to be installed on your system.
https://github.com/essentialkaos/7zcat
Also, after you download install 7zcat you have to give it execute permission with chmod. Finally, you have to execute it by calling its full path for example if you installed it to the directory you are in you would run ./7zcat file.7z or you would add the path to the file to your environment's $PATH variable.
I hope this helps. You might have to do some more research though.
When you open a Terminal window and type 7zcat and hit enter, what happens? Same message? Well, if you cannot use it, why should make be able to use it? Where and how have you installed 7z? Is the folder with the 7z binaries in your PATH? Since if it isn't, of course the command won't be found.
When the system shall run a command, it will search for this command in the directories stored in the PATH variable. Execute echo $PATH in terminal and you will get a colon separated list of directories; only these directories are searched for binaries. So either you must move your binaries to one of these (or put a symlink to one of these) or add the directory with these binaries to the PATH.
Yet there is no official 7z command line installer for MacOS, which brings me back to the original questions "Where and how have you installed 7z?" And are you sure that whatever you installed even includes a 7zcat?

unable to set Environment Variable in MacOSX

I am trying to add Racket's bin to my list of environment/path variables.
Here is the location of Racket's bin folder:
/Applications/Racket/bin
Here is what I have added to my .bash_profile file:
export PATH=$PATH:/Applications/Racket/bin
Here is the Path output from set:
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Applications/Racket/bin
However, when I run ./racket, I still get:
-bash: ./racket: No such file or directory
I am able to run ./racket from Racket's bin directory (meaning that it probably isn't a 32- v 64-bit issue).
However, when I run ./racket, I still get a "-bash: ./racket: No such
file or directory"
Run it like this instead:
racket
When you run ./racket it means run an executable racket from your current directory.

Resources