I am trying to compile a program with SimpleDateFormat and I get "cannot find symbol". I'm using Netbeans and Maven and in Netbeans, the software finds the correct import java.text.SimpleDateFormat, so it's not a question of the definitions not being there, it's the compiled classes that are missing somehow.
Any ideas what could be the problem?
My classpath:
CLASSPATH=.;C:\Program\Java\jdk.1.6.0_18\jre\lib\resources.jar;C:\Program\Java\jdk1.6.0_18\jre\lib\rt.jar;C:\Program\Java\jdk1.6.0_18\jre\lib\sunrsasign.jar
I reinstalled both netbeans and the JDK (after first uninstalling them, then removing any remaining files manually and then rebooting my computer).
This simple application demonstrates the problem:
import java.text.DateFormat;
import java.text.SimpleDateFormat;
public class DatabaseBuilder
{
private DateFormat m_formatter;
public DatabaseBuilder()
{
m_formatter = SimpleDateFormat( "yyy-MM-dd HH:mm:ss" );
}
}
Resulting output:
DatabaseBuilder.java:10: cannot find symbol
symbol : method SimpleDateFormat(java.lang.String)
location: class DatabaseBuilder
m_formatter = SimpleDateFormat( "yyy-MM-dd HH:mm:ss" );
^
1 error