Can I learn Java on my own?

I'm a 19 year old college student. I'm starting my sophomore semester soon, and I'm going for Mechanical Engineering. It's what I've always wanted to do. However I'm quite interested in learning how to code Java. To be honest Minecraft is what made it appealing to me. But it seems like a fast growing language nowadays.

My school requires me to take some kind of coding class "for engineers" and that's fine. I've actually already done some coding before. In 11th grade in high school, I did 1 year of C++ and actually quite liked it. I was disappointed at how graphics can't really be processed in c++ (my understanding though, is that game engines are typically c++ on some level?), but I still managed to like it and I even made a (not perfect) Minesweeper game of sorts. Ha!
If you want to take a look at the code, here it is:
http://s000.tinyupload.com/index.php?file_id=53558799087749960422
You can even open the.cpp file with notepad or notepad++. That is actually the hardest thing I ever made in c++ though. Haha. I did learn some about writing to and from files however. Most of what I learned is a bit hazy, but the core concepts are still there.

I would like to say that while my school does offer a class for Java, I do not want to take it. I have definitely more than enough on my plate and I don't want the responsibility of another class. I do however want to learn it in my free time (if I have any lol).

Can you point me to good sources for learning?

You surely can do graphics with C++, but the standard libraries doesn't include as much for it as for example Java. So you would have to get some libraries for it, or do it from scratch with OpenGL or DirectX for example.

You can of course learn Java on your own, especially as you know C++ you will see that the very basics are very similar, the syntax are almost identical too.

There are so many good books and websites for learning Java. Here is a website that looks good:
https://www.learneroo.com/modules/11