setenv and export

Florent Charton traydent at gmail.com
Fri Aug 21 07:50:35 UTC 2009


Le 21/08/2009 04:11, Kipton Moravec a écrit :
Hello,

> I am trying to setup java to do serial port stuff, and I do not know
> java, I just want to run a stupid program. So I have to install Sun Java
> Communications API for Linux.
>
> One of the steps is:
>
> 2. If you are using JDK (not JRE) Add comm.jar to your classpath.
>
>  Example: If you don't have a CLASSPATH set currently,
>
>      % setenv CLASSPATH `pwd`/comm.jar
>
> or,  if you have something in your CLASSPATH already,
>
>     % setenv CLASSPATH `pwd`/comm.jar:$CLASSPATH 
>
> --------------
>
> And setenv does not work. Because it is not a bash command which is the
> default for most of the Linux operating systems. It is a c shell
> command.
>
> Fortunately I was able to search and find that export is the equivalent
> command.
>
> echo $CLASSPATH
>
> Showed I did not have anything in the class path.
>
> export CLASSPATH=/home/kip/APRS/bin
>
> But it is not persistent across booting. Do I have to initialize it each
> time I want to run my program (which is from boot-up to shutdown).
>
> How is the best way to do this?
>   
Like someone else said, put the following line in your ~/.bashrc file :
    export CLASSPATH="/path/to/the/comm.jar:${CLASSPATH}"
> What is 'pwd' in the example, and why is it there? (Does it make it
> persistent?)
>   
The ` characters delimits a nested command execution : it executes the
pwd command and replaces itself with the return of the pwd command. The
pwd command Prints the current Working Directory. A replacement for the
` in bash at least is $().
> Kip
>   
Hope it helped,

-- 
~TraydenT~





More information about the ubuntu-users mailing list