# Chemical Equilibrium Calculations software
============================================

This software requires Java JDK 8 or later. It has been
tested on MacOS 12 (Monterrey) and later.

## Download
-----------

The best way to use this software under MacOS is by
downloading the file `Eq-Calc_Java.zip`
from https://github.com/ignasi-p/eq-diagr/releases  
Open Finder, go to Downloads, double click on the
file 'Eq-Calc_Java'.  Copy the folder 'Eq-Diagr'
and the file 'Readme_MacOS.txt' to your Documents
folder, or to any other folder you find convenient.

In Finder, go to Downloads and move the folder
'Eq-Calc_Java' to Bin (to trash).
 
Move also to Bin the subfolders 'Eq-Diagr/Windows-files'
and 'Eq-Diagr/ubuntu-files'.


## Java JRE is needed
---------------------

### Check that you have Java installed
Open a Terminal and enter `java -version`.
You should see what java version you have installed.
It should be 8 or higher.
To open a Terminal, click on the Launchpad and
type 'Terminal' on the search field at the top. 

### Install Java
If there is no java JRE installed, or the version is less
than 8, then open Safari and enter `www.java.com` in
the top search bar.  Click on "Download Java for Desctops".
On the next page, look at the bottom for "If you are
running on a macOS Intel (x86_64), download the x86_64
version of the JRE" and click on that link to download.
Once the `dmg`-file has been downloaded, double-click on
it in Finder.  A new window opens with a `pkg`-file.
Double-click on it to install java.  Afterwards accept
to send the installations files to Bin.


## Running the software
-----------------------

The `jar`-files may be launched from a Terminal
using the command:  
    java -jar path/name.jar  
where 'path' is the location of the 'Eq-Diagr' folder,
perhaps `~/Documents/Eq-Diagr` and 'name.jar' is
one of the `jar`-files, such as 'Spana.jar'.
For exmple, entering in the Terrminal   
    java -jar ~/Documents/Eq-Diagr/Chem_Diagr_Help.jar  
will launch the help system.

If java is installed, double-clicking on a `jar`-file
_should_ start the corresponding program (Spana,
DataBase, Chem_Diagr_Help, etc).

But if you get an error message, create script files on
the Desktop as follows:  In folder "Eq-Diagr/MacOS-files"
there is a file named `create_scripts`.  Run it from
Finder by double-clicking its name, or from Terminal
by moving to that folder and entering `./create_scripts`.
This will create `command`-files on the Desktop:
`Spana.command` and `Database.command`.

You may run the programs by double-clicking these
Desktop script files: a Terminal window will open and
the corresponding program will start.
- By default, the window will remain open after the
  script terminates.  Using the Terminal's menu
  "Preferences" you can have it to close automatically:
  choose the `Profiles` tab, then the `Shell` tab
  in Preferences, then in the drop-down menu
  "When the shell exits:" select
  "Close if the shell exited cleanly".

To change the **icon** of a Desktop script file:
right-click on the script file -> Get Info, then put
the icon you want by drag/drop an icon from folder
`Eq-Diagr/MacOS-files/icons`
to the little icon in the top-left corner of file info panel.

To add a Desktop script file to the **Dock**, drag the
command-file to the section of the Dock closest to the
trash can, on the other side of the little separator
(it won't work in the main section of the Dock, as that
area is reserved for `apps`).

If you wish you may move these `command` script-files
from the Desktop by drag-and-drop to any other folder
using Finder, such as the Applications folder.

**Note** that if you later either move or rename the folder
'Eq-Diagr', you will need to re-create the `command`
script-files.  The location of the software is hard-coded
in the Desktop `command`-files.

## Uninstall
------------

Just remove the folder "Eq-Diagr" folder, and move to Bin
any desktop icons.