You didn't actually say that you want the user to run
Ant and have Ant run a java app, but your sample makes it look that way. You can define environment variables going to Ant in the same way that you can for any Java application, using the -Dname=value command-line construct. To make it prettier (and safer), wrap the Ant command line with a shell script/batch command file.
To get the command value to the actual java app, just define a param stanza on the Ant <java> command where the value would be substituted in the usual way:
Please check your ant manual on how to pass in parameters. I'm working from my so-called memory. But I hope you get the idea.
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.