"Thinking in" is certainly commonly used when talking about languages.
Apart from your Java example (Java is a language), I am not sure if you are restricting this to languages.
I would generally agree with your teacher when you want to think in something that is not a language.
Well, one possibility is when in (something) describes the situation in which you are while you are thinking, but that is a completely different construct from "Think in German" or "Think in Java".
Leave me alone, I want to think in peace.
I would not think in table, or think in love, or think in writing.
Actually, while browsing, I am finding more and more things you can think in.
If your teacher is so stubborn that she want a dictionary, ask her why she believes her English would be better than that of
Prof Terry Barker, Founder of the Cambridge Trust for New Thinking in Economics, Chairman of Cambridge Econometrics, and Departmental Senior Fellow in the Cambridge Centre for Climate Change Mitigation Research (4CMR), Department of Land Economy, University of Cambridge
There are so many examples of "thinking in" by different native speakers of English, including academics, that I would not take anybody seriously who says "thinking in" is always wrong.