There are any number of ways:
1) Make a request from one app to the other passing the value as a request parameter.
2) Use the DB as a common data share
3) Use the file system as a common data share
4) Use RMI, JMS or another of the
Java alphabet soup technologies
5) other...