ICPooreman
asked on
edit CLASSPATH in .bashrc from schell script
I'm writing a shell script in which I want to append variable to my classpath in my .bashrc file. Is there an easy way to do this?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Do you have the "export" in place? without the "export" settings to the variable are only for the shell itself, not children - the export makes the change for the current shell's children processes (i.e. the "java" command).
The second approach would exit the command shell if there's an exit...
you can also specify classpath variables for Java, e.g.
#!/bin/bash
export MY_CLASSPATH=$CLASSPATH:my .jar
java -cp $MY_CLASSPATH my.org.HelloWorld
Cheers,
C.
The second approach would exit the command shell if there's an exit...
you can also specify classpath variables for Java, e.g.
#!/bin/bash
export MY_CLASSPATH=$CLASSPATH:my
java -cp $MY_CLASSPATH my.org.HelloWorld
Cheers,
C.
ASKER
You're right it was a typo on my side, Sorry thanks for the help
Glad to be of help!
ASKER
I'm unfamiliar with what the second option is supposed to be doing but it didn't work either. It closed down my shell and nothing happened when I ran it.