I already did this in Haskell before you changed the name to "Java". Since this is a community wiki, it doesn't matter here.
primes n =
let sieve (p:xs) = p : sieve [x | x<-xs, x `mod` p /= 0] in
let primes = takeWhile (<n) $ sieve [2..] in
([0..n] \\ primes, primes)
*Main> primes 20
([0,1,4,6,8,9,10,12,14,15,16,18,20],[2,3,5,7,11,13,17,19])
(edit :) Shortening names and removing spaces makes it 79 characters:
p n=let s(p:xs)=p:s[x|x<-xs,x`mod`p/=0];r=takeWhile(<n)$s[2..]in(r,[0..n-1]\\r)
it also produces the resulting resulting pair order, and is n-1used according to the specification.
50 :
p n=partition(\k->all((>0).rem k)[2..k-1])[2..n-1]