views:

128

answers:

3

So I have a directory of with a bunch of sub-directories that contain .java and .form files. How do I build this program? I'm sure that the program is build-able too, so I must be doing something wrong.

I'm used to writing C/C++ programs where I can just pass -I/path to gcc.

By the way, I'm using netbeans on an Ubuntu system.

Here's the output of tree:

.
|-- SimpleServerWithGUI
|-- SweepCollector
|   |-- Collector.form
|   |-- Collector.java
|   `-- sweepParser.java
|-- aGrapher
|-- basefunctionsModule
|   |-- basefunctionsModule.class
|   |-- basefunctionsModule.java
|   |-- getAction.class
|   `-- getAction.java
|-- n1996aModule
|   |-- Connection.class
|   |-- Connection.java
|   |-- N1996a.class
|   |-- N1996a.java
|   `-- n1996sweep.class
|-- newSquirrelSweepManager
|-- old
|-- squirrel
|   |-- Main.class
|   |-- Main.java
|   |-- actionList.class
|   |-- actionList.java
|   |-- commandparser.class
|   |-- commandparser.java
|   |-- squirrelAction.class
|   |-- squirrelAction.java
|   |-- squirrelLogger.class
|   |-- squirrelLogger.java
|   |-- squirrelModule.class
|   |-- squirrelModule.java
|   |-- variableList.class
|   `-- variableList.java
|-- squirrelClient
|   |-- squirrelConnection.java
|   `-- squirrelConnectionResult.java
|-- squirrelSweepManager
|   |-- BandView.form
|   |-- BandView.java
|   |-- DataAquisitionThread.java
|   |-- DataView.form
|   |-- DataView.java
|   |-- PresetView.form
|   |-- PresetView.java
|   |-- SweepManager.form
|   |-- SweepManager.java
|   |-- SweepManagerSimpleGUI.java
|   `-- sweep.txt
`-- squirrelSweepManagerDataModel
    |-- SweepBand.java
    |-- SweepData.java
    |-- SweepParameters.java
    |-- simpleSweep.java
    |-- sweep.java
    `-- sweepResult.java

11 directories, 45 files

SO now I'm at the point where I have a bunch of class files, like Main.class, how do I actually make an executable file?

+1  A: 

If you don't have any pom.xml or build.xml file in your project, your project is likely not using Maven nor Ant. So, unless you have a .bat (or .sh in your case) file somewhere, you'll have to rely on your IDE or to build the project by hand using javac, the java compiler (setting the required CLASSPATH manually).

Just for your information, the .form files are XML file that the Netbeans visual form editor uses to store information. You do not need to distribute them with your application; they are only used by the IDE. However, if you want to open your forms again in the form editor, you should keep the files.

Pascal Thivent
So how do I configure netbeans to look in the right places for my other classes?
devin
What other classes? What do you mean? I can't guess without more details on your project structure and what you've done so far. Can you paste the output of the `tree` command? Can you tell us what you've done under netbeans to setup your project?
Pascal Thivent
A: 

I think the best way is to write an ant script, if the project doesnt have one (look for build.xml) Here is an quick tutorial on ant scripts ( read time like 15min ) with some examples, i guess it will have all that you need: http://www.javaworld.com/javaworld/jw-10-2000/jw-1020-ant.html

Red33mer
awesome! This is pretty helpful.
devin
A: 

The directory structure should map onto the Java package names, so that the first java file Collector.java should belong to package SweepCollector and the file should be headed with:

package SweepCollector;

If you don't have this organisation it will be difficult to compile your code. You also have n1996sweep.class without a corresponding source file this might indicate something has got lost.

peter.murray.rust