DZone
Java Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Java Zone > Extending JVisualVM - More on Getting Started

Extending JVisualVM - More on Getting Started

Wayne Adams user avatar by
Wayne Adams
·
Oct. 03, 11 · Java Zone · Interview
Like (0)
Save
Tweet
6.22K Views

Join the DZone community and get the full member experience.

Join For Free

I'm not sure when this happened, but at some point the JDK-included VisualVM utility became extensible. This is really great news for me. Writing a profiler is a lot of work (although admittedly very interesting and fun). VisualVM has become such a great tool that I welcome the opportunity to add a plugin to it.

Oracle has provided a lot of information in this area, which I do recommend reading. Look at Getting Started extending VisualVM and a number of links at the bottom of that page. It helps a lot to get NetBeans if you don't already have it, as it has significant support built-in to develop VisualVM plugins.

Rather than repeating "getting started" info, I planned to produce an actual VisualVM plugin in this entry, but I ran into some issues with the "getting started" guide. So, this is a "getting started" update for NetBeans 7.0.1 users, especially those who have just installed it (as I have) and have not yet created any projects.

As usual, some things in the "getting started" guides don't turn out as expected. For example, the guides say to choose "Platform Manager" from the "Tools" menu; in my NetBeans 7.0.1 installation, there was no such menu item. It seems things have changed slightly. If you are using NetBeans 7.0.1, here is how I worked my way around the problem:


  1. "File", "New Project..."

  2. Under "Choose Project", choose "NetBeans Modules"

  3. Under "Projects", choose "Module"

  4. Click "Next"

  5. Click "Standalone Module"; the dropdown mostly likely says "NetBeans IDE 7.0.1...".

  6. Click on the "Manage..." button. This click will bring up the coveted Platform Manager.

  7. Click "Add Platform..."

  8. Now, rather than browse to the root folder of the VisualVM application and select that directory (Platform Manager won't let you use it), instead browse to the root folder of the JDK you are using in NetBeans, drill down into the lib directory, and select "VisualVM". Click "Next".

  9. If you're OK with the default name "VisualVM", click "Finish". I named mine "VisualVM 1.6u20", to identify which version I chose.

  10. The newly-added platform should be selected in the "Platforms:" dialog. Click "Close" and then in the "New Module" dialog, choose the VisualVM platform. Click "Next".

  11. Provide a Code Name Base for the project (an example is given in the dialog) and click "Finish". You will now have a new project that will be built against the registered VisualVM binary.


I noticed that once I created a project and opened it (using the above steps), the "Tools" menu in NetBeans 7.0.1 became much more populated, including a menu item called "NetBeans Platforms". Apparently it was necessary to create and open one project to populate the "Tools" menu (however, it stays populated even if you close the new project). The only problem is that I needed for it to be populated before I created my project, so that I could make it a VisualVM project. The above steps show you how to achieve this goal if you have a fresh NetBeans deployment.

Now, on to that plugin I was going to write... Coming soon.

 

From http://wayne-adams.blogspot.com/2011/10/extending-jvisualvm-more-on-getting.html

NetBeans Dialog (software) Directory application Java Development Kit Drill Java (programming language)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • 10 Programming Habits a Web Developer Should Embrace
  • What Are Microservices?
  • Low Code and No Code: The Security Challenge
  • No-Code/Low-Code Use Cases in the Enterprise

Comments

Java Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo