garyo edited this page Dec 13, 2014 · 1 revision

Java-Build-Run, classpath made by recursively walking through the directories.

The code compiles and runs java files.

The project attached consists of a few directories, src, bin, lib, tools. Three main-code files, SConstruct,, The functionality of the three files is explained below.

  • SConstruct contains the build code, to invoke build, $ python tools/scons/scons-local-0.98.4/ buildresource=src/somecompany/

this will build the and put the resulting class file in bin/com/somecompany/HiSCons.class.

The classpath consists of all the files in dirs/subdirs of lib, and files in src.

Whole src directory is build, if you don't specify buildresource parameter or buildresource=src.

  • compiles the .java file, by calling SConstruct and then run's it with classpath of lib and bin directories. To invoke $ python [--javaargs] src/com/somecompany/

If the class file needs input parameters to run, you can specify --javaargs, and it will prompt you for parameters.

  • contains configuration code for the project. you can change the configuration code according to your needs.

  • I looked over the internet for java 1.5 classpath, if I don't have to walk through directories and explicitely mention jars and class files in the lib(just mention lib and it automatically finds all the files), but it was not possible at least to me . Perhaps you can find a way. Java 1.6 allows some support in this regard, but since I was on 1.5 so.. The code is self explanatory, and comments are added as and when needed. It's been tested, on ubuntu, should work well on windows, except that at some points the path separator is of posix systems, e.g. src/com/somecompany/ instead of src\com\somecompany\

-- Regards, Babar Abbas,

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.