{"id":947,"date":"2018-06-18T16:33:30","date_gmt":"2018-06-18T15:33:30","guid":{"rendered":"http:\/\/hirt.se\/blog\/?p=947"},"modified":"2019-11-25T15:43:46","modified_gmt":"2019-11-25T14:43:46","slug":"fetching-and-building-openjdk-mission-control","status":"publish","type":"post","link":"https:\/\/hirt.se\/blog\/?p=947","title":{"rendered":"Fetching and Building OpenJDK Mission Control"},"content":{"rendered":"<p>(Please note that an updated version of this article, for JMC 8+, is available here: <a href=\"https:\/\/hirt.se\/blog\/?p=1196\">https:\/\/hirt.se\/blog\/?p=1196<\/a>.)<\/p>\n<p>Since people keep asking me, I thought I\u2019d put together this quick primer on how to get started with OpenJDK Mission Control. Now, once the early access builds of JMC 7 is out, that will probably be the easiest way to get started for people who don\u2019t want to change stuff. This blog, however, will be for the ones of you who would like to build JMC from source.<\/p>\n<h2>Getting Mercurial<\/h2>\n<p>First step is to get Mercurial, the SCM used for OpenJDK. JMC (being an OpenJDK project) is available through a Mercurial repository. Installing Mercurial is different for different platforms:<\/p>\n<h5>Mac OS X<\/h5>\n<p>Easiest is to install through Homebrew:<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">brew install mercurial<\/span><\/p><\/blockquote>\n<p><span style=\"font-family: Courier New\"><span style=\"font-family: Arial\">That said, dmg packages can also be downloaded from here: <a title=\"https:\/\/www.mercurial-scm.org\/wiki\/Download\" href=\"https:\/\/www.mercurial-scm.org\/wiki\/Download\">https:\/\/www.mercurial-scm.org\/wiki\/Download<\/a>. <\/span><\/span><\/p>\n<h5>Windows<\/h5>\n<p>Go to <a title=\"https:\/\/www.mercurial-scm.org\/wiki\/Download\" href=\"https:\/\/www.mercurial-scm.org\/wiki\/Download\">https:\/\/www.mercurial-scm.org\/wiki\/Download<\/a>. Download the InnoSetup based installer and run it. Ensure that the \u201cadd to path\u201d checkbox is checked. Verify that the install went fine by opening a command prompt and typing hg and enter. A list of the available commands should be printed.<\/p>\n<h5>Linux<\/h5>\n<p>For Debian based distributions, you can install using the package manager:<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">sudo apt-get install mercurial<\/span><\/p><\/blockquote>\n<p>That said, you can also get rpms and other installation packages from here: <a title=\"https:\/\/www.mercurial-scm.org\/wiki\/Download\" href=\"https:\/\/www.mercurial-scm.org\/wiki\/Download\">https:\/\/www.mercurial-scm.org\/wiki\/Download<\/a>.<\/p>\n<h2>Cloning the Source<\/h2>\n<p>Once Mercurial is installed properly, getting the source is as easy as cloning the jmc repo. First change into the directory where you want to check out jmc. Then run:<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">hg clone <a href=\"http:\/\/hg.openjdk.java.net\/jmc\/jmc\/\">http:\/\/hg.openjdk.java.net\/jmc\/jmc\/<\/a><\/span><\/p><\/blockquote>\n<h2>Getting Maven<\/h2>\n<p>Since you probably have some Java experience, you probably already have Maven installed on your system. If you do not, you now need to install it. Simply follow the instructions here:<\/p>\n<blockquote><p><a title=\"https:\/\/maven.apache.org\/install.html\" href=\"https:\/\/maven.apache.org\/install.html\">https:\/\/maven.apache.org\/install.html<\/a><\/p><\/blockquote>\n<h2>Building Mission Control<\/h2>\n<p>First we need to ensure that Java 8 is on our path. Some of the build components still use JDK 8, so this is important.<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">java \u2013version<\/span><\/p><\/blockquote>\n<p>This will show the Java version in use. If this is not a Java 8 JDK, change your path. Once done, we are now ready to build Mission Control. Open up two terminals. Yep, two!<\/p>\n<p>In the first one, go to where your cloned JMC resides and type in and execute the following commands (for Windows, replace the dash (\/) with a backslash (\\)):<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">cd releng\/third-party<br \/>\nmvn p2:site<br \/>\nmvn jetty:run<\/span><\/p><\/blockquote>\n<p>Now, leave that terminal open with the jetty running. Do not touch.<\/p>\n<p>In the second terminal, go to your cloned jmc directory. First we will need to build and install the core libraries:<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">cd core<\/span><br \/>\n<span style=\"font-family: Courier New\">mvn install<\/span><\/p><\/blockquote>\n<p>Next run maven in the jmc root:<\/p>\n<blockquote><p><span style=\"font-family: Courier New\">mvn clean package<\/span><\/p><\/blockquote>\n<p>JMC should now be building. The first time you build Maven will download all of the third party dependencies. This will take some time. Subsequent builds will be less painful. On my system, the first build took 6:01 min. The subsequent clean package build took 2:38.<\/p>\n<h2>Running Mission Control<\/h2>\n<p>To start your recently built Mission Control, run:<\/p>\n<h5>Windows<\/h5>\n<blockquote><p><span style=\"font-family: Courier New\">target\\products\\org.openjdk.jmc\\win32\\win32\\x86_64\\jmc.exe -vm %JAVA_HOME%\\bin<\/span><\/p><\/blockquote>\n<h5>Mac OS X<\/h5>\n<blockquote><p><span style=\"font-family: Courier New\">target\/products\/org.openjdk.jmc\/macosx\/cocoa\/x86_64\/JDK\\ Mission\\ Control.app\/Contents\/MacOS\/jmc -vm $JAVA_HOME\/bin<\/span><\/p><\/blockquote>\n<h2>Contributing to JDK Mission Control<\/h2>\n<p>To contribute to JDK Mission Control, you need to have signed an Oracle Contributor Agreement. More information can be found here:<\/p>\n<blockquote><p><a title=\"http:\/\/openjdk.java.net\/contribute\/\" href=\"http:\/\/openjdk.java.net\/contribute\/\">http:\/\/openjdk.java.net\/contribute\/<\/a><\/p><\/blockquote>\n<p>Don\u2019t forget to join the dev list:<\/p>\n<blockquote><p><a title=\"http:\/\/mail.openjdk.java.net\/mailman\/listinfo\/jmc-dev\" href=\"http:\/\/mail.openjdk.java.net\/mailman\/listinfo\/jmc-dev\">http:\/\/mail.openjdk.java.net\/mailman\/listinfo\/jmc-dev<\/a><\/p><\/blockquote>\n<p>If there is interest, I will add a more detailed blog post on this later.<\/p>\n<h2>More Info<\/h2>\n<p>For more information on how to run tests, use APIs etc, there is a README.md file in the root of the mercurial repo. Let me know in the comments section if there is something you think I should add to this blog post and\/or the README!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Please note that an updated version of this article, for JMC 8+, is available here: https:\/\/hirt.se\/blog\/?p=1196.) Since people keep asking me, I thought I\u2019d put together this quick primer on how to get started with OpenJDK Mission Control. Now, once the early access builds of JMC 7 is out, that will probably be the easiest [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[16,18,19],"class_list":["post-947","post","type-post","status-publish","format-standard","hentry","category-java-mission-control-fair-dj","tag-java-mission-control","tag-jdk-mission-control","tag-jdk-mission-control-7"],"_links":{"self":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/947","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=947"}],"version-history":[{"count":7,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/947\/revisions"}],"predecessor-version":[{"id":1203,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/947\/revisions\/1203"}],"wp:attachment":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=947"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}