dont you think if he wants to go in graphics designer field y in the world he wants to learn java? all he want to do is do his homework.

It doesn't matter if he is interested in it or not. If his major requires a course of this nature, then he has to do it.

In the real world you can't just simply say "I don't like that part of my job so I simply won't do it."

That would be really great. Think about it. One of the workers in a construction company doesn't like to use screw drivers so he simply places a sticker that looks like a driven-in screwhead at every spot he was suppossed to place a screw. Then your house falls apart. But don't blame him he just simply wanted to get his work done and didn't like that part of the job.

Wonderful.

Edit:

Also, whether the major demands it or not is irrelevant. He took the course, he needs to either do the work or take the hit to his record by either failing or withdrawing. Cheating is not and never was the answer. It will catch up to you sooner or later.