I have written a little bash script to switch the JAVA Version in Cygwin: http://pjsdev.blogspot.de/2013/02/cygwin-switching-java-version.html
As you can see I am using "export" to set the ENV & PATH. This works fine in command line tools running under Cygwin shell. But how can I force to set the Variables in Win7 advanced system settings? In a batch script SET would be the command to use, but are there any posibilities in Cygwin to call SET or something similar?
Take a look at How to Call the Windows API From a Cygwin Program, as you will have to call out to Windows to change the Environment for Windows programs.