I've got a jar
file that can be run from the command line like this:
# In Terminal.app
java -jar fop.jar /path/to/infile.fo /path/to/outfile.pdf
At the moment for this to work I need to navigate to the folder containing fop.jar. This isn't ideal, so I've tried to add the following alias to bash_profile
...
# In bash_profile
alias fop="java -jar /path/to/a/far/away/folder/fop-2.1/build/fop.jar"
...with the hope that I could execute this script from the Desktop (or anywhere else) like so:
# In Terminal
fop ~/Desktop/simple.fo ~/Desktop/simple.pdf
Unfortunately it's not working:
# Error message
Unable to start FOP:
java.lang.RuntimeException: fop.jar not found in directory: /my/pwd (or below)
at org.apache.fop.cli.Main.getJARList(Main.java:70)
at org.apache.fop.cli.Main.startFOPWithDynamicClasspath(Main.java:130)
at org.apache.fop.cli.Main.main(Main.java:219)
Can anyone help?