The CSR is a Certificate Sign Request. You should already self-sign the certificate or send to a certicate authority. If you are lost in this point, read the certificates howto.
Then you should have a CRT file (The CRT is a X.509 certificate in DER format) self-signed or signed by a Certificate authority, to create a PKCS#12 certificate you should:
- Transform the DER certificate to PEM.
- Mix PEM and KEY private key file into the PKCS#12 fileformat.
The openssl commands are here in "Converting Using OpenSSL" section.
This stuff is not Java, It's just SSL/TLS.