To develop and use Maxine, you need:
- Hardware requirements:
- Software requirements:
- Solaris, Solaris 11 Express, Linux, or Mac OS X.
- An installation of JDK 1.7 or OpenJDK7. We have successfully built Maxine with JDK version 1.7.0_25. It should work with other 1.7.0 versions, but sometimes changes in the JDK code require modifications to Maxine. N.B. Maxine is no longer supported on JDK 1.6.
- JUnit 4.0+.
- On Solaris, you need the libproc.h header file from OpenSolaris. Due to licensing issues, we are prevented from supplying this file with our download. You need to copy it to Native/tele/solaris/ before building Maxine's C code on Solaris.
- GNU make version 3.7.9 or later, which must be on your command path as gmake.
- A C tool chain (i.e. compiler, preprocessor and linker). We have limited resources for testing C compiler support on a wide variety of platforms. The table below lists the C tool chains that known to work (or not) for each platform. Please help us expand this compatibility matrix by leaving a comment on this page when you try building Maxine on another platform.
- Some of the support needed by the C tool chain on Mac OS X is obtained by installing Apple's Xcode tool suite. Apple recently changed the way Xcode gets downloaded and installed, and an additional step is now required beyond the standard installation. Open the Xcode application (located in the /Applications folder), open the Preferences pane, select the Downloads section, select the Components tab, and install "Command Line Tools".
|Platform||Supported C tool chain(s)||Incompatible C tool chain(s)|
|OpenSolaris 2009.06 x64|| Sun Studio 12 Update 1
|Solaris 10 x64||Sun Studio 12|
|Solaris 10 SPARCv9||Sun Studio 12|
|Mac OS X 10.5||gcc 4.2.1|
|Mac OS X 10.6||gcc 4.2.1|
|Linux 2.6.* x64||gcc 4.3.3|
- Recommended Development Tools:
As of February 2011, the Inspector's GUI toolkit defaults to the native Look & Feel (L&F) of the platform on which it runs, also known as the SystemLookAndFeel. Prior to Februry 2011, the Inspector was configured to use only the Java L&F, also known as Metal, also known as the CrossPlatformLookAndFeel. See also Available Look and Feels.
There are three ways to override the Inspector's selection of Look & Feel: two by using standard Java platform mechanisms and one by modifying Inspector source code.
- Command line: the argument -Dswing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel will force the Inspector to use the Java L&F as it did before (see Specifying the Look and Feel: Command Line).
- swing.properties file: it is possible to change the platform default L&F by putting swing.defaultlaf=javax.swing.plaf.metal.MetalLookAndFeel in the swing.properties file, whose location is platform-specific (see Specifying the Look and Feel: swing.properties File).
- MaxineInspector.java: the source line that formerly forced the Inspector to use the Metal L&F is still present; it is commented out and could be restored. See class com.sun.max.ins.MaxineInspector.
Maxine requires Java 1.7, which is not the default installed Java on Mac OS X. You must download JDK 7 from the Oracle Site, and ensure that JDK 1.7 is the default Java when building and running Maxine.
The The Maxine Inspector makes use of the task_for_pid() system call to control the Maxine process being debugged/inspected. Mac OS X restricts use of this call to processes that are either owned by root or whose group id is the procmod group. Prior to Mac OS X 10.6 (i.e. Snow Leopard), a work around for this was to setgid procmod the executable that runs the Inspector, i.e. the java binary in your JDK 1.6 installation. While this worked, it opened security vulnerabilities for other Java programs run by the same executable. A better solution is to require the Inspector to be run as root. This is now enforced in the mx script by having the Inspector launched via sudo.
One other side-effect of this security policy on Mac OS X is that the Inspector cannot be launched via an IDE unless the IDE supports prefixing the Java executable it uses with sudo. If you need to debug the Inspector on Mac OS X, then you must launch it externally to the IDE in such a way that it suspends itself and waits for a debugger to connect to it. This can be achieved via the mx script as follows:
You now need to start a remote debugging session in the IDE that connects to port 8000 (or whatever port number you choose). For example, the steps for doing this in Eclipse are:
- From the main menu bar, select Run > Debug Configurations... to open the Debug Configurations dialog.
- Double-click the Remote Java Application node to create a new launch configuration.
- In the Project field under the Connect tab, select (or type in) the Inspector project.
- Set the Host and Port fields to localhost and 8000 respectively.
- Press the Debug button.
The ideal solution would be to use the Authorization Services on Mac OS X to enable the Inspector process to dynamically elevate its privileges at run time. The Inspector includes some code (discussed in more detail here) that attempts to use these services but unfortunately, it doesn't yet work for unknown reasons. Apparently, we are not the only ones to have encountered this problem.
Currently, the JDK that ships with OpenSolaris does not include a 64-bit version of the native code used by the accessibility framework. Given that the Inspector has its own native 64-bit libraries, the JVM running it has to be launched in 64-bit mode (i.e. the -d64 VM option is used). It appears that all Swing-based apps try to load the accessibility library at some point and so the Inspector crashes at this point with an error like this:
Until the JDK on OpenSolaris includes the missing 64-bit JNI library, the workaround according to this thread on the OpenSolaris forums is to rename or remove /usr/java/jre/lib/accessibility.properties from the system.