I am a foreigner and a large company in Krakow offered me a 4000zl gross salary per month as a junior Java developer
That's 2800 PLN net, after deductions. Not worth moving to Poland for so little, even for a junior position.
That will barely cover a very frugal lifestyle, with zero luxury or savings. Throw in the cost of airfare and visa fees, and you might even end up in the red after one year. All it would take is an abscessed tooth or a couple of weeks in bed with the flu to wipe you out financially as you would have little in the way of a rainy day fund.
There are better opportunities elsewhere, and for this amount of money, there are probably better opportunities in your own country.