Will using Java or Flash via VPN break my anonymity?

I read a lot about TOR lately, including that i can browse the internet pretty much anonymously assuming my exitnode-"provider" isn't corrupted. I also read that the usage of java and/or flash might be problematic to my anonymity because the applications will establish a direct connection ignoring TOR.

Is that the case for a VPN to? would i be able to anonymously (provided my vpn provider doesnt save my logs) use java and flash via vpn? Will i be able to choose which server I use when buying an account at a commercial vpn-provider?

Flash and Java have vulnerabilities, known and unknown, its possible to compromise your anonymity through a malicious code getting access to your system, but its not really related to a VPN. The VPN just masks your true location/IP, but doesn't prevent malicious code.

The reason why this is mentioned with TOR is that the standard set up for TOR is simply using TOR Browser Bundle. This means your computer has regular Internet access but what websites you visit in TBB are routed through TOR. Now because Flash and Java although browser plug-ins they run outside of the browser. This means flash content isn't routed through TOR and then your anonymity is compromised.

A VPN routes your entire computer through the VPN so flash and Java will go through the VPN meaning it doesn't face the problem they do in TBB. Of course if there is an exploit in Flash/Java/Javascript then it is possible that the exploit can bypass the VPN. This can protected against by giving the computer zero knowledge of your real IP by running a VPN on your router. In this case even malware can't find your IP. Alternatively you can run a sandboxed OS inside a virtual machine with the VM having no knowledge of your real IP. This can be done by running a VPN on the host with a failsafe or in the case of TOR using Whonix to run a VM that has no knowledge of a non TOR IP.

VPN handles all TCP/IP connections because the tap adapter gets the lowest metric. It's perfectly possible to use your original IP address while a VPN is connected if an app supports specifying an IP to bind to. Server software can do this too and listen on the original IP. Java can do both these things. Javascript not so much.