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

  • Home
  • SEARCH
  • 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 5840623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T11:46:28+00:00 2026-05-22T11:46:28+00:00

I have the following set up: I have 4 packages: root/src/terminal – has some

  • 0

I have the following set up:

I have 4 packages:

  • root/src/terminal – has some java files
  • root/src/mail – has some java files
  • root/src/data – has some java files
  • root/src/main – has a single java file, Main.java

I also have the following files

  • root/bin – a folder to store .class files
  • root/mail.jar – a jar file which has important classes used in my code

Within the root, I would like to enter a terminal command which compiles root/src/main/Main.java and puts the class files in the root/bin location.

Can someone show me the command to do this? I’m on a Mac (running Leopard).

  • 1 1 Answer
  • 1 View
  • 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-05-22T11:46:29+00:00Added an answer on May 22, 2026 at 11:46 am

    Here’s the one liner:

    cd /xyz/root
    rm -rf bin/*
    javac -d bin -classpath mail.jar -sourcepath src main/Main.java
    

    Alternatively, you could use absolute directory names:

    rm -rf /xyz/root/bin/*
    javac -d /xyz/root/bin -classpath /xyz/root/mail.jar \
          -sourcepath /xyz/root/src /xyz/root/ main/Main.java
    

    In reference to Ant you said “I would rather keep it simple.”.

    In fact in the long term it is simpler to create a simple Ant build.xml file. The alternative is a bunch of non-portable scripts or batch file … or lots of typing.


    To run the application, assuming that you are still in the /xyz/root directory:

    java -classpath bin:mail.jar main.Main
    

    Or on Windows:

    java -classpath bin;mail.jar main.Main
    

    Or modify the above to use absolute pathnames in the classpath argument; e.g.

    java -classpath /xyz/root/bin:/xyz/root/mail.jar main.Main
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following set of data: ID | CREATED | USER -------------------------- 1
I have the following data set structure: date time_in_hours price Sep 03 08 9.76
I have the following JNI shared library located in /data/subv/Mem, I have set the
I'm trying to map a Dictionary containing Lists. I have the following set of
I'm using log4Net for my logging. I also have the following set... <log4net debug=true>
I have the following function set up to sequentially fade in divs (with class
I have the following query: SET @q = 12; UPDATE `table` SET qty =
I have the following animation set up using Three.js: http://frontier.lincoln.ac.uk/3d/development/Stage2/characters/man2.html Please ignore the ropey
I have the following relationships set up: A HABTM B B belongsTo C C
I have the following code set up in my Startup IDictionary<string, string> properties =

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.