Java is portable, but you can't make assumptions about the capabilities of the JVM. For example, some environments lack graphic display capabilities; others lack network connectivity.
In theory, C and C++ source code is portable as long as you use standard libraries or libraries you know are available on the platforms you want to support. In practice, however, not every platform implements the standard libraries in the same way, so compiling source on a new platform usually requires some sort of porting effort. What usually kills modern applications is the lack of a GUI toolkit.
If you want to write for Amiga-like operating systems, Java is definitely not the solution. Stick to C (or C++ if you have access to a well-maintained compiler).