1 Reply Latest reply on Apr 28, 2008 10:48 AM by 807557

    Any differences between javac shipped with RTJ vs javac in standard JDK?

      There are two ways to compile Java source for RTJ:

      1 - use /opt/SUNWrtjv/bin/javac
      2 - run the regular JDK javac, but add the RTJ rt2.jar file to the compile classpath

      Is there any practical difference between the two methods? Does the RTJ version of javac generate code that's better optimised for the real-time VM?

      Some more context for the question: we're running our builds from Ant/CruiseControl, so one way of building is to use the most up-to-date JDK we can on our build machine for running Cruise and Ant (since we would expect this to be faster, have less bugs etc), but for compiling our RTJ sources, we would just set the source and target flags on javac to "1.5", and point the bootclasspath at the RTJ installation. Would this be likely to cause any problems?

        • 1. Re: Any differences between javac shipped with RTJ vs javac in standard JDK
          The javac shipped with Java RTS is from JDK 5.0u13 and so may not contain fixes from later versions of javac.

          Otherwise the only difference is that the real-time VM has a different execution profile (in terms of performance and memory usage) to a regular VM, so a "real-time" javac may not be capable of compiling as many sources files together as the javac from the regular VM (at least not without tuning the RTGC :) ).

          There is no difference in the code produced in either case.

          "Cross-compiling" as you describe should not be a problem (at least there should not be any RT specific issues in cross-compiling). You need to be careful not to use any JDK 6+ API's as of course these won't be present in the JDK 5.0u13 runtime of Java RTS.

          David Holmes