United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6477844 : ToolProvider.getSystemJavaCompiler returns null

Details
Type:
Bug
Submit Date:
2006-10-03
Status:
Closed
Updated Date:
2014-01-23
Project Name:
JDK
Resolved Date:
2008-02-13
Component:
tools
OS:
windows_2000
Sub-Component:
javac
CPU:
x86
Priority:
P4
Resolution:
Not an Issue
Affected Versions:
6
Fixed Versions:

Related Reports

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0-rc"
Java(TM) SE Runtime Environment (build 1.6.0-rc-b100)
Java HotSpot(TM) Client VM (build 1.6.0-rc-b100, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows 2000 [Version 5.00.2195]

A DESCRIPTION OF THE PROBLEM :
ToolProvider.getSystemJavaCompiler returns null. This is a expected behavior if a compiler isn't supported by the runtime, according to the javadoc. However, installing the lastest Mustang on two identical windows 2000 systems renders different behaviors. Machine A, everything works as expected. Machine B, no compiler available.

REGRESSION.  Last worked in version mustang

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Attempt to get the system java compiler
In some instances it's null

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Sun's Java runtime should always return a compiler.
ACTUAL -
Null sometimes

ERROR MESSAGES/STACK TRACES THAT OCCUR :
Altough this is crictical error the method used returns null instead of throwing an exception!

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import javax.tools.*;

public class Test
{
public static void main(String ... args)
{
JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
System.out.println(compiler);
}
}

---------- END SOURCE ----------

                                    

Comments
EVALUATION

Bases on the SDN comments, I agree the problem can be reproduced if the given test program is run with JRE instead of JDK.  Assuming that this is the problem the submitter ran into, I am change the Close substatus from "Not reproducible" to "Not a defect".
                                     
2008-02-13



Hardware and Software, Engineered to Work Together