Java is a wonderful language and I was addicted to it because of ease of coding and debugging. I used CPLEX library to solve the Security Constrained Unit Commitment problem.

I was trying to read a file in java. However my code has a problem and I received errors. It was because I used a relative path to access file. However the following link helped me to resolve the problem.;:YfiG?bug_id=4483097


The part that helped me was:


Not a bug.  If you need to resolve a filename against the value of
the "user.dir" system property then you must use getAbsolutePath (or
getAbsoluteFile, or getCanonicalPath, or getCanonicalFile).  Simpler
operations such as exists() always resolve against the directory in
which the Java virtual machine was originally invoked (and no, there
is no way to change that).

-- mr@eng 2001/7/23

As an industrial engineer I love Excel because it has made analysis easier for me. My struggle to work with excel workbooks started when I was using C#, however I wanted to use it like I was using VBA which was not the best way.

With java also I tried to read from and write into excel worksheets using Apache poi.

But working with these basic classes is frustrating if you just want to read and write some tables and vectors. That's where JETT or jXLS can help you.

A comparison between these two can be found in:

 It has a lot of dependencies whose link can be found on the website. Also most of the dependencies can be found in Apache poi bundle.


JETT requires the following libraries:


  • Apache POI 3.14
    • poi-3.14-20160307.jar
    • poi-ooxml-3.14-20160307.jar
    • poi-ooxml-schemas-3.14-20160307.jar
    • Apache POI, in turn, depends on the following library: XML Beans 2.6.0.
  • XML Beans 2.6.0
    • xmlbeans-2.6.0.jar
  • Apache Commons JEXL 2.1.1
    • commons-jexl-2.1.1.jar
    • Apache Commons JEXL 2.1.1 in turn depends on Commons Logging 1.1.1.
  • Apache Commons Logging 1.2
    • commons-logging-1.2.jar
  • SourceForge's jAgg 0.9.0
    • jagg-core-0.9.0.jar
  • JUnit 4.8.2 (for testing only)
    • junit-4.8.2.jar
  • HSQLDB (for testing only)
    • hsqldb-




I used to use C++, however after I learned a little Java I switched to it because I love the code generation and the warnings it generates.


Pass by value or by reference:



 Running Java program from command shell sometimes is not easy. Gradle helps you to do that. I went through these steps to get to this result: