I was a mechanical engineer for 5 years. Luckily I worked in computer integrated manufacturing side from the beginning like Robotics, CNC programming, Managing ERP projects etc. A friend of mine who was a Java/J2EE architect encouraged me to take up
Java. It took me 6months - 1 year to self-study Java while I was working as a manufacturing engineer and then moved on to take up a Java entry level position (Luckily market was good then). I never looked back since then because I enjoyed software development so much...
I guess my training in mechanical engineering helped me a lot in terms of non-technical skills.