Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8848131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:21:22+00:00 2026-06-14T12:21:22+00:00

I downloaded apache commons FileUtils to perform a copy directory and added them under

  • 0

I downloaded apache commons FileUtils to perform a copy directory and added them under libraries in eclipse as well. When I say Fileutils.copyDirectory(s,d) as give below eclipse says ” Multiple markers at this line -Syntax error on token “(“, delete this token
-Syntax error on token “)”, delete this token”. Can someone help

import org.apache.commons.io.FileUtils;

Public class b {

    File s = new file("C://Tom//eso");         
    File d = new file("C://Tom//pos");

    FileUtils.copyDirectory(s,d);

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T12:21:23+00:00Added an answer on June 14, 2026 at 12:21 pm

    Try this:

    import org.apache.commons.io.FileUtils;
    
    public class B {
    
        public static void main(String[] args) throws Exception {
            File s = new File("C:/Tom/eso");         
            File d = new File("C:/Tom/pos");
            FileUtils.copyDirectory(s,d);
        }
    
    }
    

    There are several errors in your code:

    • Classes start with an uppercase char – it’s File, not file. And it’s class B, not class b (remember to also rename the file to B.java)
    • You must not use double / chars, just one
    • The code must reside inside a method, not at the class level
    • It’s public, not Public
    • You’re not handling exceptions, either throw them or catch them
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I only need to use this class org.apache.commons.io.FileUtils, and yet I'm downloading all commons
So today I downloaded Apache Commons Lang library (binary, zip format). I extracted it
I have: ubuntu-9.10-desktop-amd64 + NetBeans6.7.1 I just downloaded Commons HttpClient 3.1 (legacy) from http://hc.apache.org/downloads.cgi
I'd like to try org.apache.commons.lang.StringUtils in my Android project. I have downloaded commons-lang3-3.1.jar and
In Eclipse (Ganymede) I'm debugging some code that uses Apache Commons HttpClient and would
I use a code that imports the following package: import org.apache.commons.httpclient.*; I use eclipse.
I have a program that is trying to use the org.apache.commons.io.FileUtils static method readFileToString()
I am trying to download an image from URL. I use the Apache Commons
I'm using Apache's commons-net-2.2.jar to download a batch of files from a FTP server,
I downloaded apache2.2.22 src from http://httpd.apache.org/download.cgi and made the installation. The installation works fine.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.