Re: Help a newbie please?
On Apr 8, 4:03 pm, Lew <l...@lewscanon.com> 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?
(I think that's like an ant standard)
Precisely like.
Like totally almost. :)
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?