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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:37:16+00:00 2026-05-22T00:37:16+00:00

I am new to Java world. I have got few classes which are inside

  • 0

I am new to Java world. I have got few classes which are inside nested folders.

My namespace has following folder structure (Assume that companyName folder is on C:\ ):

companyName -> isuName -> projectName -> module1 -> sampleclass1.java
companyName -> isuName -> projectName -> module2 -> sampleclass2.java
companyName -> isuName -> projectName -> module3 -> codePart3.1 -> sampleclass3.java
companyName -> isuName -> projectName -> module3 -> codePart3.2 -> sampleclass4.java

My problem is, I want to compile all of these classes from command prompt.

I tried the following command but its not working :

C:\> javac -sourcepath companyName\*.java

but its not working. I am getting following error :

javac: no source files
Usage: javac <options> <source files>

Please help to compile all of these classes and possibly to create jar out of it.

  • 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-22T00:37:16+00:00Added an answer on May 22, 2026 at 12:37 am

    I looked at the manual page for javac, and it seems you’ll have to spell out the source files on the command line, or you’ll have to list them in a separate file, and reference that file on the command line.

    I set up the first two source files in your question in a similar tree, and compiled them as follows:

    C:\>"\Program Files\Java\jdk1.6.0_24\bin\javac.exe" company\isu\project\module\HelloJava.java company\isu\project\module\ByeBye.java
    

    Using the other method, I produced this file:

    C:\>type sourcefiles.txt
    company\isu\project\module\HelloJava.java
    company\isu\project\module\ByeBye.java
    

    Then I fed that file to the javac compiler, prepending the “@” specifier per the manual.

    C:\>"\Program Files\Java\jdk1.6.0_24\bin\javac.exe" @sourcefiles.txt
    

    The manual page for jar doesn’t seem to yield the same techniques, so I specified the files on the command line as before.

    C:\>"\Program Files\Java\jdk1.6.0_24\bin\jar.exe" -cf myjar.jar company\isu\project\module\HelloJava.class company\isu\project\module\ByeBye.class
    

    Of course, doing it this way is somewhat tedious, so I highly recommend Ant, which you can run on Windows.

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

Sidebar

Related Questions

I am pretty new to the whole Java and OSGi world and I have
I am new to Java world but I am pretty good at using Flex,
I'm new in the Java world and I'm totally confused with the sheer number
I'm brand new to java, coming from a ruby world. One thing I love
In Java (Swing), say I've got a 2D game where I have various types
I am new to Java and referring Head-First book. Do I have to learn
I have found the following post, which I think I may help because I
Let's assume we've got the following Java code: public class Maintainer { private Map<Enum,
I'm a C# ASP.net MVC Developer. I got a new job and have to
I am writing a curriculum project for students new to Java. It has a

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.