Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 161
  • Last Modified:

Compiling error : variables in intern class

This doesn't compile :

            String configPath = conf.getString("path")+collection.getName()+"\n"+collection.getFileName();
            String logPath = conf.getString("path")+collection.getName()+"\n"+collection.getLogName();
      
            new Thread() {
                  public void run () {
                        net.sf.regain.crawler.Main.main(new String[] {
                              " -forceNewIndex",
                              " -config "+configPath,
                              " -logConfig "+logPath
                        });
                  }
            }.start();

because it can't find configPath  and  logPath  in anonyme thread class.
What is the best way to do ?

Thanks.
0
matthew016
Asked:
matthew016
1 Solution
 
enachemcCommented:
declare the configPath and logPath as memeber variables of your class.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now