Giannis
Giannis

Reputation: 5526

Add files permanently on CLASSPATH

I need to add some files on my CLASSPATH so I am using the following command:

export CLASSPATH=$CLASSPATH:/usr/local/lib/antlr-4.0-complete.jar

Although everytime my terminal is reseted, I have to add the classpath again. Is there a way that I can permamently add the above file on classpath ?

Commands are executed on OSX.

Upvotes: 1

Views: 987

Answers (1)

Matti Lyra
Matti Lyra

Reputation: 13088

You should edit a file called ~/.profile and add the

export CLASSPATH=$CLASSPATH:/usr/local/lib/antlr-4.0-complete.jar

to that file. If ~/.profile doesn't exist then create it. The file is executed each time a new shell session is started.

Upvotes: 2

Related Questions