?
Solved

Compiling error : variables in intern class

Posted on 2006-11-30
1
Medium Priority
?
159 Views
Last Modified: 2010-05-18
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
Comment
Question by:matthew016
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 12

Accepted Solution

by:
enachemc earned 2000 total points
ID: 18043795
declare the configPath and logPath as memeber variables of your class.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Suggested Courses

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question