How do you compile multiple class files in a unix cmd prompt?

I have been using Java for a few years now, but for some reason I have a course that requires us to compile/run and hand-in our java assignments using Unix...
I know how to compile a simple program on unix with a single source file, but how the heck do you compile and run a program with say... 2 or more sources files linked together?
I really doubt the answer is just type
javac java1.java
javac java2.java
javac java3.java
and then running the source file with the main in it.
Hopefully someone here can help me.
Thanks
Roger

okay, well I took some time to read up online how to do this and I guess i'll answer my own post just in case someone else wants to know the answer.
2 ways I found were:
1)For example, you can list all of the source file names in a file named sourcefiles. This file might look like:
MyClass1.java
MyClass2.java
MyClass3.java
You could then run the compiler with:
% javac @sourcefiles
2)Or if all the files are in the same directory you can do this:
This example compiles all the source files in the package greetings.
% ls
greetings/
% ls greetings
Aloha.java GutenTag.java Hello.java Hi.java
% javac greetings/*.java
If that is confusing to read I found all the answers from this webpage:
http://java.sun.com/j2se/1.3/docs/tooldocs/solaris/javac.html

Similar Messages

  • How do you join multiple video files?

    I have multiple video files, all encoded with same codec, together so that I have 1 single large file. How do I do it with FCP? Ive tried doing it, but for some reason the final file is twice as large as the sum of the individual files...
    Thanks!!

    When you export an FCP edit, you get one file from many.
    If the individual files are all sequenced on one track, with no gaps between them,
    AND everything is all the same codec, the output file will be approx. the same size
    as the sum of the input files.
    You might be accidentally using a different codec, however. Verify by opening
    a source clip and your export clip in QuickTime Player, and selecting Get Info.
    Compare pixel dimensions, frame rate, etc.

  • How do i compile a class file to become an exe (application file)

    I know jbuilder and other 3 rd party software are able to to that. I just want to know whether jdk1.3 compiler able to do it...

    Hm ...
    if you think of a compiler producing an executable file, this means, the application is compiled, linked and bound at file-level - what about the features of loading and linking classes during runtime or the ability to replace class files during runtime and load/link it dynamically?- Guess, a compiler for java can compile static applications, which need no dynamic linking of classes, but is it also able to keep this functionality of java this way?- I don't think so (but I never tested one of these compilers).
    greetings Marsian

  • How do you open multiple binary files and plot them all on the same graph?

    I have three different binary files and I want to plot all 3 of them onto a graph.
    I am familiar with opening and reading a single binary file. (Thanks to the help examples!) 
    But to do multiple numbers at the same time?  I was thinking of putting 3 different 'reading from binary file' blocks with the rest of the 'prompts', 'data type', etc.. and then connecting them on the same wire.
    However, I got into a mess already when I tried to read one .bin file to dynamic data type --> spectral measurements --> graph waveform.  The error was Not enough memory to complete this operation...  Why is that?  That didnt happen in the help example "Read Binary File.vi"...  Has it got something to do with the dynamic data type?
    Thank you for your time.
    Jud~

    Have a look at the image below and attached VI.  Simply enter the different paths into the PathArray control.
    R
    Message Edited by JoeLabView on 07-30-2008 09:59 PM
    Attachments:
    multipleBinary2Graph.vi ‏18 KB
    multipleBinary.PNG ‏5 KB

  • How do you merge multiple .pdf files into one?

    I have four different .pdf files that I need to merge into one. How can I do that?
    Thanks in advance for your help.

    Do not reply there... but did you read the answer to your previous (wrong forum) question?
    http://forums.adobe.com/thread/423012?tstart=0

  • How do you find multiple original files in itunes? Many threads no answer

    I tried looking through a lot of topics that had similar problems but haven't run across an answer yet. I am trying to locate original files for itunes. The library is directed to an external HD. The files are in the HD and I can 'find' them one at a time. As with others on this forum, I don't want to do it individually. Any one know an easy way to point to the music folder for all the titles?.
    I actually have the whole library on a travel drive as well and it seems to find them there. If the travel drive is unplugged, then it cannot find the original. I'm guessing that there is a path that needs to be followed and yet in the advanced prefs it is pointing correctly.

    *Don't move any media* until your library is working reliably.
    My experience is that you can move the "library" files (outside the red box) anywhere and provided the "content" (inside the red box) stays put iTunes will find the files. You can also move the library as a whole, "library" & "content", when nested as shown. Typically when people run out of room they follow a guide which explains how to relocate the content only using iTunes to manage the shift. This has two drawbacks, first iTunes can sometimes fail to complete the operation leading to an unstable library and second it complicates things when unxpected system changes occur.
    You might find your existing library and content will reconnect if you edit the location of the iTunes Media folder in preferences to the current location, close iTunes and reopen.
    iTunes 9 will work perfectly well with files in the older layout. If you "upgrade" to *iTunes Media Organisation* it should reorgainse the files, but similar caveats obtain. If iTunes crashes while moving the files about (as has heppened to others posting here) then repairing things is complicated. The automated process also fails to rename *iTunes Music* to *iTunes Media*
    Again, from my own tests and when properly nested, iTunes will accept the renaming of the *iTunes Music* folder as *iTunes Media* and update the iTunes Media folder preference automatically. If that works and you then close & reopen iTunes and everything still works normally, you can try pushing an Artist folder into iTunes\Media\Music. I think it works, but I manage the structures inside iTunes Media manually & I don't have time to test it just now. If iTunes doesn't llike any step you take just put things back where the were. You can always let iTunes manage the iTunes Media Organsiation upgrade if you have a decent backup and can restore.
    tt2

  • How can you convert multiple PDF files at once to PDF/A-1b files

    I support individuals who on occasion have to submit a mass of files to a court and the requirement is that the files be in PDF/A format. Most are scanned files lacking the requisite structure to become PDF/A-1a files. So as I convert or resave files, I need to be able to specify that they be converted to the PDF/A-1b standard. And since it may involve over 100 files, it would be very inefficient to do so individually, file by file. Could this be done via an Action Wizard sequence? Could a script be written in Java that go through such a process, specifically choosing a PDF/A standard? Any insights would be appreciated.

    PDF/A-1a is very easy to automate in Acrobat XI Pro, indeed the compliance code was rewritten specifically with this in mind. Test Screen Name is correct that PDF/A-1b can't be realistically automated due to the complexity of tagging, but that's not your concern.
    In Acrobat XI Pro, create a new Action with no functional steps in it, then add the Save step.
    Click 'Settings' and change the output format to "Export File(s) to Alternate Format"
    Choose PDF/A from the list. It doesn't say so, but that's A-1b.
    I suggest using the file renaming feature so you're not overwriting the originals (e.g. append "_A1B")
    Save the Action and run it.
    Files with security, distributed forms, etc. can't be converted but the Acrobat engineering team claim that everything which can possibly be shoehorned into PDF/A will always succeed. In previous versions of Acrobat it often failed when it encountered things like iffy XMP data.

  • How do you rename multiple files at the same time

    how do you rename multiple photo files with a name at the same time?

    This would be an excellent use of Automator. Here is a link to some instructions on how to do this using Automator.
    http://www.youtube.com/watch?v=Ie6zGxo2D-o
    If you don't like that then Google "Renmame multiple files Automator" and you will find many tutorials available.

  • How to compile and register a Java CFX tag with multiple class files?

    All-
    If this is the wrong forum for CFX questions, please let me
    know.
    I need to determine how to compile and register a Java CFX
    tag that contains multiple class files. One class file implements
    the CustomTag interface and the other class files implement various
    supporting classes. All of the documentation that I have found
    talks about using a single class file. I am assuming that a JAR
    file will be involved, but I am not sure of the specifics.
    Thanks in advance for your help.
    -Josh

    Yes, it will involve a jar. Use your java IDE (eclipse,
    etcetera ..) to create a jar containing all of the classes. Check
    your ide's documentation for how to create jar files. After you
    have created the jar, place the jar in the CF class path so CF will
    recognize it. For example the {cf_root}/WEB-INF/lib directory. CF
    must be restarted before it will detect the new jar. After
    restarting CF, register the CFX tag in the ColdFusion Administrator
    using the name of the class that implements the CustomTag
    interface.
    Though it is worth noting you can also instantiate java
    classes directly from ColdFusion (ie without using a CFX
    tag).

  • How do you compile Flex-dependent classes with ASC?

    Hi,
    I've been trying unsuccessfully for most of the evening to compile a .as file that relies on mx.collections.ListCollectionView using asc. I figured I could just import the Flex framework SWCs from the command line with asc, but asc doesn't seem to respect SWCs - it only seems to respect .abc files.
    So, I've spent most of my time trying to compile the Flex framework into a single .abc file that I can import whenever I want to compile a class that relies on Flex. I figured I could make a base .as file with include statements for all of the Flex .as files (copying the approach I saw for files like builtin.as) and compile that, but all I seem to get are compiler errors - mostly "[Compiler] Error #1181: Forward reference to base class (base class name)."
    I have a feeling I'm doing this completely the wrong way. I'd very much appreciate any assistance that anybody can offer me.
    Thanks,
    - max

    <div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>I use MXMLC to compile my .as file projects.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Alex Harui<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Flex SDK Developer<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><a href="http://www.adobe.com/"><span style='color:blue'>Adobe<br />Systems Inc.</span></a><o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Blog: <a href="http://blogs.adobe.com/aharui"><span<br />style='color:blue'>http://blogs.adobe.com/aharui</span></a><o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Maxim Porges<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Monday, February 09, 2009 9:22 PM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> How do you compile Flex-dependent classes with ASC?<o:p></o:p></span></p><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new discussion was started by<br />Maxim Porges in <br><br /><br><br /><b>Developers</b> --<br><br />  How do you compile Flex-dependent classes with ASC?<br><br /><br><br />Hi, <br><br /><br><br />I've been trying unsuccessfully for most of the evening to compile a .as file<br />that relies on mx.collections.ListCollectionView using asc. I figured I could<br />just import the Flex framework SWCs from the command line with asc, but asc<br />doesn't seem to respect SWCs - it only seems to respect .abc files. <br><br /><br><br />So, I've spent most of my time trying to compile the Flex framework into a<br />single .abc file that I can import whenever I want to compile a class that<br />relies on Flex. I figured I could make a base .as file with include statements<br />for all of the Flex .as files (copying the approach I saw for files like<br />builtin.as) and compile that, but all I seem to get are compiler errors -<br />mostly &quot;[Compiler] Error #1181: Forward reference to base class (base<br />class name).&quot; <br><br /><br><br />I have a feeling I'm doing this completely the wrong way. I'd very much<br />appreciate any assistance that anybody can offer me. <br><br /><br><br />Thanks, <br><br /><br><br />- max <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b7d5d2">How do you compile<br />Flex-dependent classes with ASC?</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b7d5d2!folder=.3c060fa3">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div>

  • How do you select multiple files to drag

    How do you select multiple files to drag from one folder to another? Is there a command?

    Open the folder which has the contents you want to transfer.  Press COMMAND 'A' and then all of the data should be highlited in blue.  Drag it to the new folder.
    If only certain files are to be transferred, then you have to select them (COMMAND 'A')  individually and the drag them as a group to the new location.
    Ciao.

  • How do you select multiple files at one time

    How do you select multiple files at one time

    Select one, and then either command-click another, or in list/column view, Shift-click the item at the other end of the range you want to select. Alternatively, click on a spot in the screen and drag the cursor until all the files are selected.
    (114308)

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • Compiling multiple java files present in different packages simultaneously

    Hi,
    I have multiple java files which are present in different folders.
    In some cases, files are importing classes from other packages i.e. some kind of inter-dependency
    How do I compile these java files simultaneously?
    Any help would be highly appreciated.

    Pawan_Anand wrote:
    Hi,
    I have multiple java files which are present in different folders.
    In some cases, files are importing classes from other packages i.e. some kind of inter-dependency
    How do I compile these java files simultaneously?
    Is it circular?
    Thus the dependency is A => B => C => A?

  • Help compiling with .class files

    I am using JGrasp and I am trying to compile a program that uses .class files instead of the .java files, but JGrasp will not recognize these at compile time. How do I get my program to compile with these .class files?

    I prefer using Jenuity:
    [http://www.nmmu.ac.za/jenuityIDE]
    It's much simpler to use than JGrasp and isn't nearly as confusing.
    For the record, you compile .java files into .class files. There is no need to "compile" existing .class files. If you have the class files you can run them from the command line. e.g. if you have a class file named Orange.class you should be able to type "java Orange" from the command line to run it. If Orange is inside a directory structure based on packages you may need to execute this command from just outside the 'highest" folder.
    If you just need to link to these class files, copy them into the "/jre/lib/ext" folder of your JDK.

Maybe you are looking for