2
|
1 |
Working On Java[TM] Management Extensions (JMX[TM)) Using NetBeans IDE
|
|
2 |
|
|
3 |
README FIRST
|
|
4 |
|
|
5 |
make/netbeans/README for getting started with NetBeans IDE and OpenJDK,
|
|
6 |
and workings with OpenJDK NetBeans projects.
|
|
7 |
|
|
8 |
This README focusses on working on the OpenJDK JMX API using NetBeans IDE.
|
|
9 |
|
|
10 |
This NetBeans project for OpenJDK JMX allows you to modify, build, and test
|
|
11 |
the JMX API in a standalone manner. It can also be used to generate
|
|
12 |
the JMX API documentation for preview.
|
|
13 |
|
|
14 |
The JMX API does not contain native code. It is a pure java library.
|
|
15 |
You do not need to install all the Java SE sources to work on JMX,
|
|
16 |
you only need the following subset:
|
|
17 |
|
|
18 |
make/netbeans/
|
|
19 |
src/share/classes/com/sun/jmx/
|
|
20 |
src/share/classes/javax/management/
|
|
21 |
test/TEST.ROOT
|
|
22 |
test/com/sun/management/
|
|
23 |
test/java/lang/management/
|
|
24 |
test/javax/management/
|
|
25 |
|
|
26 |
If you don't want to build the whole JDK, you will also need a
|
|
27 |
pre-built version of OpenJDK (or JDK 7). Edit your
|
|
28 |
|
|
29 |
$HOME/.openjdk/build.properties
|
|
30 |
|
|
31 |
file (create it if you don't have one yet) and set the bootstrap.jdk variable
|
|
32 |
point to that JDK:
|
|
33 |
|
|
34 |
bootstrap.jdk=<JDK_7_HOME>
|
|
35 |
|
|
36 |
Then from within NetBeans IDE open the JMX project, and invoke the
|
|
37 |
"Build Project" and "Test Project" target. Note that running all the
|
|
38 |
tests for JMX takes a while. The build may also fail if it doesn't
|
|
39 |
find a directory named src/${platform}. This may happen if you haven't
|
|
40 |
installed all OpenJDK sources. In this case, you can simply
|
|
41 |
create an empty directory with the name expected by the build mechanism.
|
|
42 |
|
|
43 |
Which tests are run are defined by the jtreg.test variable declared
|
|
44 |
in make/netbeans/jmx/build.properties. Note that JMX tests are all
|
|
45 |
placed under test/javax/management/. test/java/lang/management/
|
|
46 |
and test/com/sun/management/ contain some tests that happen to
|
|
47 |
use JMX and we therefore recommend to run these tests too.
|
|
48 |
|
|
49 |
If you are working on a JMX fix, don't forget to create a
|
|
50 |
corresponding jtreg unit test under test/javax/management/.
|
|
51 |
You can look at existing tests to see how this is done.
|
|
52 |
|
|
53 |
The set of actions defined in this project are:
|
|
54 |
|
|
55 |
* Build Project:
|
|
56 |
|
|
57 |
- Compiles JMX API source files and puts the class files under
|
|
58 |
build/${platform}-${arch}/classes.
|
|
59 |
|
|
60 |
- Generates a JMX jar file under dist/lib/jmx.jar. To use your modified
|
|
61 |
JMX classes instead of the built-in JDK classes you will need
|
|
62 |
to put this jar file in front of the bootclasspath:
|
|
63 |
|
|
64 |
java -Xbootclasspath/p:dist/lib/jmx.jar mytestapp.MyAppMainClass
|
|
65 |
|
|
66 |
* Generate Javadoc for Project
|
|
67 |
|
|
68 |
- Generates the JMX API Documentation under
|
|
69 |
|
|
70 |
build/${platform}-${arch}/javadoc/jmx.
|
|
71 |
|
|
72 |
* Test Project
|
|
73 |
|
|
74 |
- Runs the JMX and Management and Monitoring jtreg unit tests.
|
|
75 |
|
|
76 |
- The results are written under build/${platform}-${arch}/jtreg/jmx
|
|
77 |
and the HTML test report can be found at
|
|
78 |
build/${platform}-${arch}/jtreg/jmx/JTreport/report.html.
|
|
79 |
|
|
80 |
* Clean Project
|
|
81 |
|
|
82 |
- Cleans the files created by this projet under build/
|
|
83 |
Some files may remain.
|
|
84 |
|
|
85 |
|
|
86 |
IMPORTANT NOTE
|
|
87 |
|
|
88 |
Please make sure to follow carefully the governance rules documented at
|
|
89 |
http://openjdk.dev.java.net/
|
|
90 |
|