agents-jade

why Runtime.instance always giving me error


hey everyone i'm new at #jade and now i'm trying to write #main class and i have error at "#Runtime rt=new Runtime.instance();" this line ,i added all external jars for jade but still have this problem what dose that mean pLiz help

import jade.core.Runtime; public class Main {

public static void main(String[] args) {
    Runtime rt=new Runtime.instance();

}

Solution

  • instance method is a static method that returns the instance of Runtime class. you needn't use operator new. That is, try to use Runtime rt=Runtime.instance();