1. It is near trivial for an experienced programmer in that language to do the task: You don't belong applying for this job. Example: Python. If you can't setup a python virtual env in about 30s... don't apply for a python job.
2. It is near impossible without their IDE settings. Java projects can be like this, at times. Though usually not to the tune of 3 hours, but I could see it getting there with a complex J2EE + database setup.
Know which case you are in, judge accordingly.
Personally: I never do take homes, unless I have a good feel for the company. If the take home is given by HR. Welcome to my circular file. This is a hard and fast rule at this point. If the hiring manager wants me to do it... That's different. But I want to talk to them and decide if this is worth my time first.