Solved

Compiling error : variables in intern class

Posted on 2006-11-30
1
153 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java passing arguments (type error) 2 48
micro services spring boot application error 3 143
Spring Framework HTTPSession management 1 23
javap bin 2 27
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
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 will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

911 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

22 Experts available now in Live!

Get 1:1 Help Now