This week's book giveaway is in the Programmer Certification forum.
We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line!
See this thread for details.
Win a copy of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 this week in the Programmer Certification forum!

Samuel Penn

Greenhorn
+ Follow
since Nov 04, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Samuel Penn

Hello, I'm a longtime user of this site, but was only really lurking on here with no identity. I decided to make an account to show explain how to fix this issue (at least for me).

How I found the problem?
I was struggling with this issue for quite a while too. When looking at the stack-trace, I noticed that even if I had no code running in my main method (except a System.out.print message) , my message still wouldn't print. I did a bit of digging into it and realised that the referenced library also contained a "main" method. You can find this in here "com.mysql.cj.jdbc.admin.TimezoneDump". Upon finding this, it was obvious that my main method wasn't being run at all.

The Solution(s)
After realising that this was the issue, the most logical solution I could come up with was run-time configurations. Looking at this I noticed that for some reason, Eclipse had made the TimezoneDump class main run instead of my code.
One of the solutions to fix this is to delete this specific run-time configuration.
The other solution (And easiest) is to simply run your code directly. Personally, I choose the latter because I didn't want to have to click twice every time I ran my code.

I hope this helps you guys, it was a big face-palm for me when I noticed that this was the issue. Thank you for all your contributions towards helping me debug code in the past.

Cheers!
~ Sam