Where can I get free access to a Java API and demo account?

What the title says…looking for a good place where I can open a demo account and simulate real market conditions. I’m particularly interested in testing some ideas of mine for automating trades. I’ve programmed in C/C++, Java, Perl, PHP, so I can likely adapt to whatever language the API supports - but I’d prefer Java.

I’m in college and I’ve taken upper level math and econ classes including Time Series, Regression, Internationals Finance, and a few others…in class all we discuss is theory but now I’m ready to get my feet wet. Plus I’ve been a programmer since I was like 13 years old…figured this would be a fun experiment.

Any help would be appreciated, thanks!

Oanda has a Java-based API. But they charge a hefty fee to use it as I understand.

MT4 uses the MQL scripting language, which is somewhat loosely similar to C++. And you can play around with it for free as long as you want. It’s also free to use on a live account.