Re: a little confused about packages...
- From: "Bjorn Abelli" <bjorn_abelli@xxxxxxxxxxxxxxxxxxxxx>
- Date: 30 Jun 2006 19:09:21 +0200
<jon23d@xxxxxxxxx> wrote...
Bjorn's solution worked just fine, though the IDE doesn't
seem to take care of this on its own. The errors that in
a console are the same errors that I get in the ide...
It's been ages since I used JBuilder, but I think that you can set specific
directories only when dealing with "projects". I.e. that you in the project
can setup both for where to find source code, where to put compiled code,
and consequently which classpath to use for the specific project.
I'm sure there's just a setting somewhere that needs
changing, but perhaps I am better off learning
this way anyways!
Probably, but in the next step you might want to look into how to use the
directing switches for "javac" and "java", in order to get more control of
what you produce. This is what the IDE's can do for you with the above
mentioned settings, but it'll always help to understand them outside the IDE
as well.
Somewhat like this should be more likely that you end up with in larger
projects:
Let's say that you have the directories:
~/devel/java/src/
~/devel/java/classes/
You have all the source code files in the "src" directory, and you want to
use the "classes" directory for the compiled code. When executing the
commannds you will be in the directory:
~/devel/java/
There you can e.g. compile with...
javac src/*.java -d classes/
....and e.g. run it with:
java -cp classes/ TestPkg.TestPkg
This was just an example, but as you'll see, it will create the directory
structure for you, corresponding to the package names, when compiling.
I believe that it will simplify things for you in the long run.
Thanks for all your help.
You're welcome.
/// Bjorn A
Inviato da X-Privat.Org - Registrazione gratuita http://www.x-privat.org/join.php
.
- References:
- a little confused about packages...
- From: jon23d
- Re: a little confused about packages...
- From: Petterson Mikael
- Re: a little confused about packages...
- From: jon23d
- Re: a little confused about packages...
- From: Oliver Wong
- Re: a little confused about packages...
- From: jon23d
- a little confused about packages...
- Prev by Date: Re: Reading in a Dictionary File
- Next by Date: Re: beginner to Java
- Previous by thread: Re: a little confused about packages...
- Next by thread: Represent work in progress on std out
- Index(es):
Relevant Pages
|