Is this a problem in the ant build.xml?

S

SpreadTooThin

1st) I'm on a mac. Mac OS X 10.5
2nd) I have jar files that my application requires to build.
Those jar files are in the source code code tree in the library
directory.
build.xml
build
libraries <---
products
source

when i run ant from the shell I get an error message saying that my
import file can not be found.

[javac] pathtomycode/source/java/org/rsna/ctp/stdstages/
sFtpExportService.java:18: package com.sshtools.j2ssh does not exist
[javac] import com.sshtools.j2ssh.SshClient;


If however I put my jar files in a directory called:
/System/Library/Java/Extensions

Then I am able to build without errors.

I suspect this is something to do with environment variables or my ant
build.xml file.

should I post the portion of my build file?
I've looked through the environment variables for reference to that
path and don't find it...

Is it permissions on the jar files?
-rw-r--r--@ 1 user user 31605 28 Apr 2007 commons-logging.jar

What is that @ symbol after the permissions on the file?
 
M

Mark Space

SpreadTooThin said:
Is it permissions on the jar files?
-rw-r--r--@ 1 user user 31605 28 Apr 2007 commons-logging.jar

Owner has read/write, everyone else has read.
What is that @ symbol after the permissions on the file?


I think that's a symbolic link, but I don't use macs and I'm not positive.

The other bit probably involves some parameter to ant to tell it where
your .jar files are. I haven't learned how to use ant, though I
probably should.
 
L

Lew

SpreadTooThin said:
1st) I'm on a mac. Mac OS X 10.5
2nd) I have jar files that my application requires to build.
Those jar files are in the source code code tree in the library
directory.
build.xml
build
libraries <---
products
source

when i [sic] run ant from the shell I get an error message saying that my
import file can not be found.

[javac] pathtomycode/source/java/org/rsna/ctp/stdstages/
sFtpExportService.java:18: package com.sshtools.j2ssh does not exist
[javac] import com.sshtools.j2ssh.SshClient;


If however I put my jar files in a directory called:
/System/Library/Java/Extensions

Eschew the extensions directory. It's for adding JARs to make them
essentially part of the core Java language, nearly always a bad idea.
Then I am able to build without errors.

I suspect this is something to do with environment variables or my ant
build.xml file.

Not envars but the classpath.
<http://ant.apache.org/manual/using.html#path>

RTFM.
 
A

Arne Vajhøj

SpreadTooThin said:
1st) I'm on a mac. Mac OS X 10.5
2nd) I have jar files that my application requires to build.
Those jar files are in the source code code tree in the library
directory.
build.xml
build
libraries <---
products
source

when i run ant from the shell I get an error message saying that my
import file can not be found.

[javac] pathtomycode/source/java/org/rsna/ctp/stdstages/
sFtpExportService.java:18: package com.sshtools.j2ssh does not exist
[javac] import com.sshtools.j2ssh.SshClient;


If however I put my jar files in a directory called:
/System/Library/Java/Extensions

Then I am able to build without errors.

I suspect this is something to do with environment variables or my ant
build.xml file.

should I post the portion of my build file?

You javac task in your build.xml should specify classpath to your SSH
jar file.

Arne
 
J

John B. Matthews

Mark Space said:
Owner has read/write, everyone else has read.


I think that's a symbolic link, but I don't use Macs and I'm not
positive.

After a name, it indicates a symbolic link. Among the attributes, it
means the file has metadata (extended attributes) that can be displayed
with -@. See also `xattr -h`:

<http://www.manpagez.com/man/1/ls/>

[...]
 
R

Roedy Green

If however I put my jar files in a directory called:
/System/Library/Java/Extensions

I am not familiar with the Mac, so I will answer as if you asked about
ANT on Windows. I will leave it up to you to translate to the
equivalent.

you need
SET ANT_HOME=E:\apache-ant-1.7.1

There are many ext directories. To be safe, put your aux jars in all
of them.

see http://mindprod.com/jgloss/ext.html

Check your script for drive letters and directories that may need
adjustment.

see http://mindprod.com/jgloss/ant.html for other tips.
--
Roedy Green Canadian Mind Products
http://mindprod.com

Now for something completely different:
 
J

John B. Matthews

Roedy Green said:
If however I put my jar files in a directory called:
/System/Library/Java/Extensions
[...]
you need
SET ANT_HOME=E:\apache-ant-1.7.1

/usr/bin/ant is already in your PATH unless you've changed it.
There are many ext directories. To be safe, put your aux jars in all
of them.

No. The System property java.ext.dirs includes several directories; use
one or none; using the first is relatively safe; forget the others:

/Library/Java/Extensions
/System/Library/Java/Extensions
/System/Library/Frameworks/JavaVM.framework/Versions...

Better: Add the missing ssh library path to the classpath attribute in
the javac task in build.xml:

<http://ant.apache.org/manual/CoreTasks/javac.html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top