Skip to main content

Hi,

I'm using Visual Cobol for Eclipse on Redhat.

I know I can compile Visual Cobol Projects on Eclipse, but how to compile them with Command Line?

There's SQL Preprocessor , and CP Preprocessor used in my projects.

One Compile Command that could compile the whole project is the best (even all projects) .

If each program need a compile command , that would took a lot of work... 

Thanks

Hi,

I'm using Visual Cobol for Eclipse on Redhat.

I know I can compile Visual Cobol Projects on Eclipse, but how to compile them with Command Line?

There's SQL Preprocessor , and CP Preprocessor used in my projects.

One Compile Command that could compile the whole project is the best (even all projects) .

If each program need a compile command , that would took a lot of work... 

Thanks

Hi Zhang Xin,

 

You've asked how to compile Visual COBOL for Eclipse projects at the command line. Visual COBOL for Eclipse uses Apache Ant as a build engine. You can use Ant yourself from the command line to request build of COBOL projects. Here is a link to a page in the Visual COBOL documentation that describes how to do this in Unix/Linux environments:

 

Building a project using Apache Ant

Blair


Hi Zhang Xin,

 

You've asked how to compile Visual COBOL for Eclipse projects at the command line. Visual COBOL for Eclipse uses Apache Ant as a build engine. You can use Ant yourself from the command line to request build of COBOL projects. Here is a link to a page in the Visual COBOL documentation that describes how to do this in Unix/Linux environments:

 

Building a project using Apache Ant

Blair

Thanks for the response.

I don't know much about ANT, but could you please check the following question?

My project is using SQL Preprocessor and CP Preprocessor,

so it's been set [ P(cobsql) END-COBSQL p(cp) ENDP ] on Eclipse.

If I try to use ANT,

Do I have to write this command into ANT setting File manually (a build.xml ?)  ?

I just want to know the compile command what I already set into Eclipse,

whether effective on ANT automatically ?

Waiting for your response, thank you


Thanks for the response.

I don't know much about ANT, but could you please check the following question?

My project is using SQL Preprocessor and CP Preprocessor,

so it's been set [ P(cobsql) END-COBSQL p(cp) ENDP ] on Eclipse.

If I try to use ANT,

Do I have to write this command into ANT setting File manually (a build.xml ?)  ?

I just want to know the compile command what I already set into Eclipse,

whether effective on ANT automatically ?

Waiting for your response, thank you

Since you already have an Eclipse project set up, your Eclipse project has automatically created an Ant script - this is what the IDE uses to build your project. On Linux, this Ant script is a hidden file named .cobolBuild in the project directory.

 

From the command prompt on Linux, you'll have to first ensure you have the environment set up for running COBOL - one way to do this is by sourcing (or dotting in) the cobsetenv script that is provided with the product. For example:

. /opt/microfocus/VisualCOBOL/bin/cobsetenv

Now, if you cd to the project directory and then run the Ant command shown on that Documentation page I referenced:

 

ant -lib $COBDIR/lib/mfant.jar -f .cobolBuild

 

Then the project will be rebuilt. 


Since you already have an Eclipse project set up, your Eclipse project has automatically created an Ant script - this is what the IDE uses to build your project. On Linux, this Ant script is a hidden file named .cobolBuild in the project directory.

 

From the command prompt on Linux, you'll have to first ensure you have the environment set up for running COBOL - one way to do this is by sourcing (or dotting in) the cobsetenv script that is provided with the product. For example:

. /opt/microfocus/VisualCOBOL/bin/cobsetenv

Now, if you cd to the project directory and then run the Ant command shown on that Documentation page I referenced:

 

ant -lib $COBDIR/lib/mfant.jar -f .cobolBuild

 

Then the project will be rebuilt. 

Thanks for the response.

I just installed Apache Ant on Linux, and I'll try it

Thank you.