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 8078433
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:47:30+00:00 2026-06-05T15:47:30+00:00

I have a jar file with predefined entry point in its manifest file. And

  • 0

I have a jar file with predefined entry point in its manifest file. And it can successfully be executed.

hadoop jar hadoop-test-1.0.2.jar -write -nrFiles 1 -fileSize 10
TestDFSIO.0.0.4
12/06/11 21:35:09 INFO fs.TestDFSIO: nrFiles = 1
12/06/11 21:35:09 INFO fs.TestDFSIO: fileSize (MB) = 10
12/06/11 21:35:09 INFO fs.TestDFSIO: bufferSize = 1000000
12/06/11 21:35:09 INFO fs.TestDFSIO: creating control file: 10 mega bytes, 1 files
12/06/11 21:35:09 INFO fs.TestDFSIO: created control files for: 1 files
12/06/11 21:35:10 INFO mapred.FileInputFormat: Total input paths to process : 1
12/06/11 21:35:10 INFO mapred.JobClient: Running job: job_201206110904_0029
12/06/11 21:35:11 INFO mapred.JobClient:  map 0% reduce 0%
12/06/11 21:35:25 INFO mapred.JobClient:  map 100% reduce 0%
12/06/11 21:35:37 INFO mapred.JobClient:  map 100% reduce 100%
...

Now my concern is how to execute the jar without the options.
I mean I just want to invoke:

hadoop jar hadoop-test-1.0.2.jar

I need to somehow define the arguments like "-write -nrFiles 1 -fileSize 10" inside the jar file. But how?

How can I define it in the manifest file? I know that I can generate a class of my own which then initiates the test class with these parameters. But is there any other workaround?

Surprisingly: Defined a class which calls the required class with the args.

Execution try:

hadoop jar hadoop-test-1.0.2.jar 
RunJar jarFile [mainClass] args...

With the name of the class as arg, it works!

hadoop jar hadoop-test-1.0.2.jar Start
TestDFSIO.0.0.4
12/06/12 01:05:11 INFO fs.TestDFSIO: nrFiles = 10
12/06/12 01:05:11 INFO fs.TestDFSIO: fileSize (MB) = 1000
12/06/12 01:05:11 INFO fs.TestDFSIO: bufferSize = 1000000
12/06/12 01:05:11 INFO fs.TestDFSIO: creating control file: 1000 mega bytes, 10 files
12/06/12 01:05:11 INFO fs.TestDFSIO: created control files for: 10 files
12/06/12 01:05:11 INFO mapred.FileInputFormat: Total input paths to process : 10
12/06/12 01:05:12 INFO mapred.JobClient: Running job: job_201206110904_0033
...

Content of my Manifest:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.1
Created-By: 20.1-b02 (Sun Microsystems Inc.)
Main-Class: Start

Name: org/apache/hadoop
Implementation-Title: Hadoop
Implementation-Version: 1.0.2
Implementation-Vendor: Apache

The content of the Start.java:

import org.apache.hadoop.fs.TestDFSIO;
public class Start {

        public static void main(String[] args) throws Exception{
                String [] myargs  = {"-write","-nrFiles","10","-fileSize","1000"};

                TestDFSIO.main(myargs);

        }
}

What am I doing wrong? Why am I not able to execute Start using the jar file without args to execute the original class TestDFIO? Thx!

  • 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-05T15:47:31+00:00Added an answer on June 5, 2026 at 3:47 pm

    Nope. You can either create a new main method or get the arguments from somewhere else, for example, a config file, environment variables, etc.

    You could also just write a wrapping shell script that does that part.

    Without knowing why you need to do this it’s more difficult to provide actionable ideas.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is is mandatory to have classpath inside a Manifest file inside the java jar
I have a JAR file Movie Library.jar, its contents are depicted below: The class
I have a jar file with several classes which have static main methods. Can
i have a .jar file, which I can run on the command line: java
I have a jar file that contains source code. How can I browse this
I have a *.jar file. Its *.java reads from console a undefined number of
I have a jar file with multiple executable classes, how can I run the
I have created jar file for my project. It is running successfully. There is
I have jar file which is signed on my local machine. Its working fine
I have a jar file which mentions the main class in the manifest. When

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.