Re: Help a newbie please?
- From: SpreadTooThin <bjobrien62@xxxxxxxxx>
- Date: Wed, 8 Apr 2009 15:36:23 -0700 (PDT)
On Apr 8, 4:03 pm, Lew <l...@xxxxxxxxxxxxx> wrote:
SpreadTooThin wrote:
As I am in xcode, and xcode uses a build.xml file. Should I not
modify the build.xml file somehow?
If you read the Ant documentation they document how to specify
classpaths.
So then I modify the jarpath?
Like totally almost. :)(I think that's like an ant standard)
Precisely like.
Also, given the names of the jar [sic] files I mentioned above, should my
code import them?
You import classes, not JARs.
I mean
import j2ssh.*;
or
import j2ssh-common-0.2.9;
import j2ssh-daemon-0.2.9;
import j2ssh-ant-0.2.9;
import j2ssh-core-0.2.9;
No. Those imports are meaningless.
Use 'import' to specify the fully-qualified name (FQN) of a class so
that you can use the simple name in the rest of the code. Check out
the Java tutorial on java.sun.com.
As an example, if you use the type java.util.Collection, you can
either refer to it by the FQN in your code:
Right like 'using namespace something' in c++... If I understand you.
public class Foo
{
private java.util.Collection stuff;
...
}
or import the name (not the class!):
import java.util.Collection;
public class Foo
{
private Collection stuff;
...
}
The purpose of 'import' is strictly a convenience for source code to
make names shorter and more readable. It has no relevance to bytecode
and doesn't do anything to classes.
Read the tutorial.
--
Lew
Ok but I'm still wondering what the FQN is of methods / names in the
jar files are.
and the syntax of the import line. I mean can you tell from the jar
file?
.
- Follow-Ups:
- Re: Help a newbie please?
- From: Arne Vajhøj
- Re: Help a newbie please?
- From: Mark Space
- Re: Help a newbie please?
- References:
- Help a newbie please?
- From: SpreadTooThin
- Re: Help a newbie please?
- From: Owen Jacobson
- Re: Help a newbie please?
- From: SpreadTooThin
- Re: Help a newbie please?
- From: Lew
- Help a newbie please?
- Prev by Date: Re: Swing - paintComponent not called
- Next by Date: Re: Help a newbie please?
- Previous by thread: Re: Help a newbie please?
- Next by thread: Re: Help a newbie please?
- Index(es):
Relevant Pages
|