Solved

Compiling error : variables in intern class

Posted on 2006-11-30
1
152 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
1 Comment
 
LVL 12

Accepted Solution

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

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

747 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now