 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Tim Julian Guest
|
Posted: Mon Mar 21, 2005 10:05 pm Post subject: Non graphics simple java |
|
|
I recently purchased Jbuilder. I just want it to run simple standard, non-graphics java programs (with String[] args). How do I import old code and run with String[] args? I created a folder c:javaHelloWorld. Under this folder I have created a HelloWorld.java file that takes String[] args. How do I get Jbuilder to easily suck up this non-graphics hierarchy, compile it, and how do I get it to take the String[] args?
|
|
| Back to top |
|
 |
John McGrath [TeamB] Guest
|
Posted: Mon Mar 21, 2005 11:22 pm Post subject: Re: Non graphics simple java |
|
|
On 3/21/2005 at 5:05:52 PM, Tim Julian wrote:
| Quote: | How do I get Jbuilder to easily suck up this non-graphics hierarchy,
compile it,
|
In my opinion, the easiest way to do this is to just create a JBuilder
project (File | New Project), and then copy the source files into the
source directory for the project. The source files should be placed in
directories that correspond to their package, so the source file for
package "com.acme" would go in directory <project-root>/src/com/acme.
Note that there is an "Project for existing code" wizard, however I have
never seen how this provides any advantage over just creating a project.
Maybe someone else can explain what advantage it provides.
| Quote: | how do I get it to take the String[] args?
|
This is specified through Run Configurations. If you have a fixed set of
arguments you want to use, you can just enter them into the "Application
parameters" field of the run configuration. If you want to run the
program with different arguments each time, you can use the "$Prompt"
macro.
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
|
|
| Back to top |
|
 |
Bill Joy Guest
|
Posted: Tue Mar 22, 2005 3:02 am Post subject: Re: Non graphics simple java |
|
|
There are two wizards available for doing this.
One is the Project for Existing Code wizard. It only works if your code is
in a directory structure that matches its package structure. You give it a
root directory to begin scanning. It uses Java source, Java objects, and
JAR files it encounters to create/initialize a project file. If it sees JAR
files, it will create a project library for you. It does not move/copy any
files.
Another is the Import Source wizard. Your source files do not have to be in
a special order. You give it a root directory and it identifies both Java
source files and Java resource file types (for instance .gif files). It
then copies them to the source path of the currently active project to a
directory structure that matches the package information in the source.
(Resource file types need to be intermixed or in a subdirectory under where
Java source files are seen to provide package information.) I find this an
extremely useful wizard.
"Tim Julian" <tim.julian (AT) hsc (DOT) utah.edu> wrote
| Quote: |
I recently purchased Jbuilder. I just want it to run simple standard,
non-graphics java programs (with String[] args). How do I import old code
and run with String[] args? I created a folder c:javaHelloWorld. Under
this folder I have created a HelloWorld.java file that takes String[]
args. How do I get Jbuilder to easily suck up this non-graphics
hierarchy, compile it, and how do I get it to take the String[] args?
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|