specific questions will get you more help sooner. right now, nobody knows if you need help installing the jdk, writing some code, getting it to compile, if it dies while running, or if it runs but gives the wrong output.
each problem requires a different kind of help. we can't really do anything until we know where you need the help.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors