how to compile a multi-source program

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

how can I compile B.class?
LVL 2
hakossemAsked:
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.

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

Just compile them like this..

javac a.java
javac b.java

If b is using a then compile a first.
0
heyhey_Commented:
or use
 javac a.java b.java
or even :)
 javac *.java
0
matchzCommented:
There have a java compiler from IBM called jikes.
Download from here:
http://www10.software.ibm.com/developerworks/opensource/jikes/index.html

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.
0
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.

heyhey_Commented:
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
0
ramshakalCommented:
For compiling such multisource program
javac *.java is best method.
0

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
wildwildCommented:
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.
0
heyhey_Commented:
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.
pfu
0
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
Java

From novice to tech pro — start learning today.