Java Cross-compiling in Eclipse for beaglebone

Can anyone explain how to configure Eclipse IDE in order to enabling java cross-compile for beaglebone?

I have found several tutorials about how to cross compile c++ codes in eclipse but there is no information about how to do the same for java codes. Can I use eclipse IDE in my Ubuntu desktop computer to cross-compile java codes for my beaglebone with ubuntu running on it? I can compile java codes in BBone so can’t I use this compiler in my desktop computer ?

Any help will be greatly appreciated and thanks in advance.

Java is an interpreted language and so does not need to be cross-compiled; your jar file will run regardless. If you are using any libraries with native components (rxtx comes to mind, I'm sure there are more), you will have to install the corresponding native versions on the Beaglebone.

C++ code is actually compiled to machine code, which is specific to the architecture it runs on; this is why there are dedicated cross-compilation options for C++. It's probably worth noting that, as a result, C++ runs quite a bit faster than Java for high-performance processing applications.

-- Robert Ying