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
  • 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-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

How to convert row into column.I have following result set. UserID VendorName QuestionText AnswerText
I have to following sproc: USE [CW] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER
Let's says I have a set of tables that match the following scenario: Crates
I have the following models: class Survey < ActiveRecord::Base set_primary_key :survey_id # I'm using
I have the following query. but it gives me error in the in clause.
I have the following code: http://jsfiddle.net/3fT2M/ Why isn't the two floated div background color
I am learning python and django. I need to do extensive stuff for data
I am trying to set up my project (built in Codeigniter) in Apache/2.0.52 (CentOS)
I’m trying to make an embedded web page on my blackberry app, and I'm
Can I display a single message for the multiple form fields in CodeIgniter? For

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.