2

I'm trying to set up Antlr 4.5 as per the instructions here but the alias isn't accessible from where I've put my project after a reboot, which makes me wonder if I've done the classpath step correctly.

The tutorial says to add export CLASSPATH=".:/usr/local/lib/antlr-4.5-complete.jar:$CLASSPATH" to .bash_profile or whatever my startup script is.

After finding that .bash_profile didn't exist on my system I discovered that the Ubuntu equivalent is apparently .profile. As a result I put that line on the end thinking that was right.

But the aliases don't survive the reboot either, so what am I missing? do I need to add the following to .profile too?

alias antlr4='java -Xmx500M -cp "/usr/local/lib/antlr-4.5-complete.jar:$CLASSPATH" org.antlr.v4.Tool'
alias grun='java org.antlr.v4.runtime.misc.TestRig'
Force Gaia
  • 145
  • 5

1 Answers1

1

I'd put both your export definitions and the alias commands to your .bashrc.

Sylvain Pineau
  • 61,564
  • 18
  • 149
  • 183
  • I've heard mixed reports about editing .bashrc most saying not to edit it. so i'm a bit confused as to why you would edit it when most say not to. and what's the difference between it and .profile or .bash_profile – Force Gaia May 05 '15 at 11:59
  • @ForceGaia Check [How do I create a permanent Bash alias?](http://askubuntu.com/questions/17536/how-do-i-create-a-permanent-bash-alias) – Sylvain Pineau May 05 '15 at 12:09
  • 1
    @ForceGaia nobody says not to edit `.bashrc`. If anyone does, they don't know what they're talking about. `.profile` is not read by most shells (for more detail than you probably want, see [here](http://askubuntu.com/a/438170/85695)), the correct file to edit is `~/.bashrc`. – terdon May 05 '15 at 12:12
  • I must have been confused by something then – Force Gaia May 05 '15 at 12:13
  • alias works now but my makefile isn't picking up on it for some reason – Force Gaia May 05 '15 at 12:23
  • 1
    @ForceGaia It's hard to tell what's causing it. Could you please create a new question for your Makefile issue explaining/detailing what you're trying to achieve and which commands are failing? – Sylvain Pineau May 05 '15 at 12:28
  • solved it. one of my tutors had a means i wasn't expecting - an executable shell script that make could pick up – Force Gaia May 05 '15 at 17:03