0
votes

I'm using an (admittedly aged) version of Scons (2.0.1; upgrading possible but might be difficult), and I'm having trouble with the "Jar" builder. Specifically, it isn't available, and I don't know why. The "JavaClassFile" builder is available and works correctly, but it can't build my jar, failing with this error:

scons: Reading SConscript files ... AttributeError: 'SConsEnvironment' object has no attribute 'Jar': File "/home/fred/comms/SConstruct", line 183: envWithJava.Jar(target='util/myproject.jar', source=['util/myproject.class', 'util/jasypt.jar', 'util/bcprov-ext-jdk15on-152.jar', 'util/Manifest.txt'])

The relevant SConstruct excerpt:

env.Jar(target='util/myproject.jar', source=['util/myproject.class', 'util/jasypt.jar', 'util/bcprov-ext-jdk15on-152.jar', 'util/Manifest.txt'])

"BUILDERS:" from env.Dump() does not list "Jar", but has numerous others, and builds C, C++, Flex and other sources fine.

I'm mainly looking for a way to debug what's happening inside of Scons to make it skip the builder. The jar command is in the same dir as javac, and that builder works, so it doesn't seem path related. The Python files that have the Jar references are present in the lib used by Scons.

Any ideas?

1

1 Answers

1
votes

My guess is that you either have no "jar" executable installed (can you call it on the command line?), or it's located in a path that hasn't been properly propagated to your Environment. See also #1 of the "most asked FAQs" at http://scons.org/wiki/FrequentlyAskedQuestions and the very java-specific bug report at http://scons.tigris.org/issues/show_bug.cgi?id=2730 .