HI! I want to interface PIC18F4550 with Java program and make it cross-platform initially. There are only one way I now Java has is javacomm. But i want it to be USB because not every laptop has RS232 port nowadays. Waht are the ways of interfacing PIC with Java you can suggest to make it really cross-platform and avoid writing driver for every new OS?
First the disclaimer: I have not done this with a PIC and Java, only with an AVR32B with VB on the pc.
If you implement a USB CDC class device on the microcontroller USB interface and connect it to your pc USB HOST it will enumerate and appear as a new COM: port. This is then treated by the application as a normal serial port. I used the standard windows driver USBSER.SYS.
I presume that microchip provide example source code for their USB peripheral to allow it to operate in different device classes. (I know that Atmel do for the AVR32 families)
Arduino's approach should be adaptable to your needs: a microcontroller with hardware UART coupled with a FTDI USB-to-TTL chip, then use rxtx to access the resulting serial port on "100+" platforms.
This approach seem to work well: communicating and programming the arduino is very easy under Linux, Windows, and OS X.
Why did you accept the answer above? I agree with @Ian's comment there.
The PIC18F4550 and its friends have onboard USB. It is easy and there are plenty of examples out there to put a virtual serial port in the PIC firmware. Another other is an HID device, again plenty of PIC firmware examples.
Don't add more hardware to the pudding.