testQuartz.class如下
import org.quartz.*;
import java.util.*;
public class testQuartz
{
public static void main(String args[])
{
//System.out.println("11");
SchedulerFactory schedFact = new org.quartz.impl.StdSchedulerFactory();
try
{
Scheduler sched = schedFact.getScheduler();
sched.start();
JobDetail jobDetail = new JobDetail("myJob",
sched.DEFAULT_GROUP,
DumbJob.class);
SimpleTrigger trigger = new SimpleTrigger("myTrigger",
sched.DEFAULT_GROUP,
new Date(),
null,
0,
0L);
sched.scheduleJob(jobDetail, trigger);
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
DumbJob.class如下
import org.quartz.*;
public class DumbJob implements Job {
public DumbJob() {
}
public void execute(JobExecutionContext context)
throws JobExecutionException
{
System.err.println("DumbJob is executing.");
}
}
Jbuilder加载了quartz.jar,编译无错误,运行时候显示错误如下
D:\JBuilder2005\jdk1.4\bin\javaw -classpath "D:\workplace\Jbulider-P1\classes;D:\JBuilder2005\lib\quartz.jar;D:\JBuilder2005\jdk1.4\jre\lib\im\indicim.jar;D:\JBuilder2005\jdk1.4\jre\lib\im\thaiim.jar;D:\JBuilder2005\jdk1.4\jre\lib\ext\dnsns.jar;D:\JBuilder2005\jdk1.4\jre\lib\ext\sunjce_provider.jar;D:\JBuilder2005\jdk1.4\jre\lib\ext\ldapsec.jar;D:\JBuilder2005\jdk1.4\jre\lib\ext\localedata.jar;D:\JBuilder2005\jdk1.4\jre\lib\jsse.jar;D:\JBuilder2005\jdk1.4\jre\lib\plugin.jar;D:\JBuilder2005\jdk1.4\jre\lib\sunrsasign.jar;D:\JBuilder2005\jdk1.4\jre\lib\charsets.jar;D:\JBuilder2005\jdk1.4\jre\lib\rt.jar;D:\JBuilder2005\jdk1.4\jre\lib\jce.jar;D:\JBuilder2005\jdk1.4\jre\javaws\javaws.jar;D:\JBuilder2005\jdk1.4\lib\tools.jar;D:\JBuilder2005\jdk1.4\lib\dt.jar;D:\JBuilder2005\jdk1.4\lib\htmlconverter.jar" org.quartz.impl.QuartzServer
java.security.AccessControlException: access denied (java.util.PropertyPermission org.quartz.properties read)
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:269)
at java.security.AccessController.checkPermission(AccessController.java:401)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:524)
at java.lang.SecurityManager.checkPropertyAccess(SecurityManager.java:1276)
at java.lang.System.getProperty(System.java:573)
at org.quartz.impl.StdSchedulerFactory.initialize(StdSchedulerFactory.java:274)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1035)
at org.quartz.impl.QuartzServer.serve(QuartzServer.java:95)
at org.quartz.impl.QuartzServer.main(QuartzServer.java:273)
向高手求助,在线等~~~~~