how to compile a multi-source program

I have a program a class A in
and i have a class B that use the class A in the file

how can I compile B.class?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I'm not sure entirely what you mean...the order you compile in is not really relevant.

Just compile them like this..


If b is using a then compile a first.
or use
or even :)
 javac *.java
There have a java compiler from IBM called jikes.
Download from here:

You can compiler java source with the following commands:
jikes *.java
The compiler would run through the source once and get the dependence information. It would compile the source in order of dependence.
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

javac will do the same.
the main difference is that javac is written in Java, and jikes is written in 'pure c++' :), that's why jikes is much quicker
For compiling such multisource program
javac *.java is best method.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I'm not sure what are the question u ask. But in my opinion , if u are use multi class in your program, u can type them in a file name. Just one of them is a
"public class.......

// the rest//

class .....

// program//

I hope these is the answer u want.
Proposed Answer
From: ramshakal
Date: Thursday, January 20 2000 - 01:00PM PST
For compiling such multisource program
javac *.java is best method.

what an EXPERT answer.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.