Page 1
Getting started, using a bare-bones shell
Page 2
Index
See this article in english 
Page 3
Getting started, using Eclipse

Getting started, using NetBeans

Alexander Hristov

This article will focus on setting up an appropriate environment for compiling and running the compiler and the regression tests under NetBeans 5.5. This is the platform of choice for Sun, so it's (almost) the easyest way.

Incorporating the project into NetBeans is trivial. Uncompress the compiler distribution somewhere (preferably a path that does not contain spaces), then simply choose File -> Open Project and select the "compiler" subdirectory:

Netbeans

NetBeans will automatically import the project structure base and will name it "openjdk-javac". Now build the whole project (press F11, or expand the build.xml file and right-click on the "build" target, then select "Run Target "):

Netbeans

If everything is right, you should see something like this:

prep:
Created dir: F:\javac-nb\compiler\build\bootclasses
Created dir: F:\javac-nb\compiler\build\classes
Created dir: F:\javac-nb\compiler\dist\bin
Created dir: F:\javac-nb\compiler\dist\lib
check-javac.isuptodate:
build-lib.javac.jar:
Created dir: F:\javac-nb\compiler\build\gensrc\com\sun\tools\javac
Copying 1 file to F:\javac-nb\compiler\build\gensrc\com\sun\tools\javac\resources
Compiling 251 source files to F:\javac-nb\compiler\build\bootclasses
Note: F:\javac-nb\compiler\src\share\classes\com\sun\tools\javac\util\JavacFileManager.java 
 uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
recompiling compiler with itself
Copying 7 files to F:\javac-nb\compiler\build\classes
Building jar: F:\javac-nb\compiler\dist\lib\javac.jar
build-bin.javac:
Copying 1 file to F:\javac-nb\compiler\dist\bin
build:
BUILD SUCCESSFUL (total time: 17 seconds)

Running the regression tests is also easy, but a few things need to be fixed. Uncompress the jtreg test harness somewhere, then open the build.properties file of the openjdk-javac project (For some reason, in the distribution I used that file was marked as "Read Only", so first make it writable).  You must uncomment the lines jtreg.home and test.jdk.home and configure them to point to the locations of the test harness and the home directory of the jdk against which you want to run the tests. For example:

 
build.jdk.version = 1.7.0
build.release = -opensource
build.number = b00
build.user.release.suffix = _
build.full.version = --


# Set jtreg.home to jtreg installation directory
jtreg.home =  f:/jtreg


# Set test.jdk.home to baseline JDK used to run the tests
test.jdk.home = c:/Archivos de Programa/Java/jdk1.6.0


compiler.source.level = 1.5

The first distributed versions of the compiler tests had some problems that prevented them from running under Netbeans/Eclipse properly (you can find a detailed description in the openjdk mailing list), but these bugs have now been fixed.

To run the tests, simply expand the build.xml file, right click on "xtest" and select "Run" :

Netbeans

You should get something similar to:

 
prep:
check-javac.isuptodate:
build-lib.javac.jar:
build-bin.javac:
build:
xtest:
Passed: tools\javac\4980495\static\Test.java
Passed: tools\javac\4980495\std\Test.java
...
FAILED: tools\javac\VarDeclarationWithAssignment.java
Passed: tools\javac\Verify.java
Passed: tools\javac\VerifyDA.java
Passed: tools\javac\VoidArray.java
Test results: passed: 1.052; failed: 69; error: 6
Report written to F:\javac-nb\compiler\build\jtreg\report\report.html
Error: Some tests failed or other problems occurred.
Results written to F:\javac-nb\compiler\build\jtreg\work
BUILD SUCCESSFUL (total time: 12 minutes 28 seconds)

If you are interested in the reasons for which a specific test failed, you can go to the compiler/build/jtreg/work/tools/javac directory and check the appropriate .jtr report file.

 

 

 

Comments

May 11, 2008 at 00:06 Sent by David E.
Hello: Please send me info. on this topic. Thanks David

 

Add a Comment

Name (optional)
EMail (optional, will not be displayed)

Text