• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • Last Modified:

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?
0
hakossem
Asked:
hakossem
1 Solution
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

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

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now