This code showcases the Melissa Profiler Object using Java.
Please feel free to copy or embed this code to your own project. Happy coding!
For the latest Melissa Profiler Object release notes, please visit: https://releasenotes.melissa.com/on-premise-api/profiler-object/
For further details, please visit: https://docs.melissa.com/on-premise-api/profiler-object/profiler-object-quickstart.html
The console will ask the user for:
- A csv that contains data that you would like to profile
And return
- TableRecordCount
- ColumnCount
- ExactMatchDistinctCount
- ExactMatchDupesCount
- ExactMatchLargestGroup
- ContactMatchDistinctCount
- ContactMatchDupesCount
- ContactMatchLargestGroup
- HouseholdMatchDistinctCount
- HouseholdMatchDupesCount
- HouseholdMatchLargestGroup
- AddressMatchDistinctCount
- AddressMatchDupesCount
- AddressMatchLargestGroup
- States and Counts
- Postal Patterns and Counts
- Linux 64-bit Java 19.0.2, Ubuntu 20.04.05 LTS
- Melissa data files for 2025-Q3
This is the c++ code of the Melissa Object.
- libmdProfiler.so
- mdProfiler.dat
- mdProfiler.mc
- mdProfiler.cfg
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. This project is compatible with Java 19
Before starting, make sure that Java has been correctly installed on your machine and your environment paths are configured.
You may find detailed instructions here: https://javahelps.com/install-oracle-jdk-19-on-linux
You can download Java 19 here: https://www.oracle.com/java/technologies/downloads/#jdk19-linux
Or you may also download Java 19 onto your Linux-based computer with
wget --no-check-certificate -c --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/java/19/latest/jdk-19_linux-x64_bin.tar.gz
You may have to add "sudo" before the above command as well if you are using a virtual machine.
Next, navigate to where the JDK was downloaded and extract the contents. You may use the command:
sudo tar -xvzf ~/Downloads/jdk-19_linux-x64_bin.tar.gz
Next, set up your environment. Start by entering the command sudo nano /etc/environment
to bring up your environment PATH and add /usr/lib/jvm/jdk-19.0.1/bin
. PATH variable must be separated by a colon so be sure to add one to the beginning of the path if there are already variables present.
Note that the version of the Java 19 JDK you downloaded may be slightly different, in which case be sure to adjust your statements accordingly. For example you may need to add /usr/lib/jvm/jdk-19.0.2/bin
to you PATH instead depending on if Java has updated their Java 19 JDK
Next add the line JAVA_HOME="/usr/lib/jvm/jdk-19.0.1"
to the end of the file.
Your file should look something like this:
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/lib/jvm/jdk-19.0.1/bin"
JAVA_HOME="/usr/lib/jvm/jdk-19.0.1"
Press ctrl + X exit and Y to save the file.
If you already have a version of JDK installed then you will want to add Java 19 JDK as an alternative shortcut. To do so enter:
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-19.0.1/bin/java" 0
and
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-19.0.1/bin/javac" 0
Then to set these shortcuts enter:
sudo update-alternatives --set java /usr/lib/jvm/jdk-19.0.1/bin/java
and
sudo update-alternatives --set javac /usr/lib/jvm/jdk-19.0.1/bin/javac
Again note that you may need to change the specific version of Java to the one you downloaded.
You can check that your environment is set up correctly by opening a command prompt window and typing the following:
java --version
If you see the version number then you have installed Java and set up your environment paths correctly!
git clone https://github.com/MelissaData/ProfilerObject-Java-Linux
cd ProfilerObject-Java-Linux
Melissa Updater is a CLI application allowing the user to update their Melissa applications/data.
-
In the root directory of the project, create a folder called
MelissaUpdater
by using the command:mkdir MelissaUpdater
-
Enter the newly created folder using the command:
cd MelissaUpdater
-
Proceed to install the Melissa Updater using the curl command:
curl -L -O https://releases.melissadata.net/Download/Library/LINUX/NET/ANY/latest/MelissaUpdater
-
After the Melissa Updater is installed, you will need to change the Melissa Updater to an executable using the command:
chmod +x MelissaUpdater
-
Now that the Melissa Updater is set up, you can now proceed to move back into the project folder by using the command:
cd ..
- Using Melissa Updater
- It will handle all of the data download/path and dll(s) for you.
- If you already have the latest release zip, you can find the data file(s) in there
- To pass in your own data file path directory, you may either use the '--dataPath' parameter or enter the data file path directly in interactive mode.
- Comment out this line "DownloadDataFiles $license" in the bash script.
- This will prevent you from having to redownload all the files.
To be able to run the bash script, you must first make it an executable using the command:
chmod +x MelissaProfilerObjectLinuxJava.sh
Then you need to add permissions to the build directory with the command:
chmod +rwx MelissaProfilerObjectLinuxJava
As an indicator, the filename will change colors once it becomes an executable.
Parameters:
-
--file: a test csv file
This is convenient when you want to get results for a specific csv file in one run instead of testing multiple csv files in interactive mode.
-
--dataPath (optional): a data file path directory to test the Profiler Object
-
--license (optional): a license string to test the Profiler Object
-
--quiet (optional): add to command if you do not want to get any console output from the Melissa Updater
When you have modified the script to match your data location, let's run the script. There are two modes:
-
Interactive
The script will prompt the user for a csv file, then use the provided csv file to test Profiler Object. For example:
./MelissaProfilerObjectLinuxJava.sh
For quiet mode:
./MelissaProfilerObjectLinuxJava.sh --quiet
-
Command Line
You can pass a csv file and a license string into the
--file
and--license
parameters respectively to test Profiler Object. For example:With all parameters:
./MelissaProfilerObjectLinuxJava.sh --file "MelissaProfilerObjectSampleInput.csv" ./MelissaProfilerObjectLinuxJava.sh --file "MelissaProfilerObjectSampleInput.csv" --license "<your_license_string>"
For quiet mode:
./MelissaProfilerObjectLinuxJava.sh --file "MelissaProfilerObjectSampleInput.csv" --quiet ./MelissaProfilerObjectLinuxJava.sh --file "MelissaProfilerObjectSampleInput.csv" --license "<your_license_string>" --quiet
This is the expected outcome of a successful setup for interactive mode:
Troubleshooting for errors found while running your program.
Error | Description |
---|---|
ErrorRequiredFileNotFound | Program is missing a required file. Please check your Data folder and refer to the list of required files above. If you are unable to obtain all required files through the Melissa Updater, please contact technical support below. |
ErrorLicenseExpired | Expired license string. Please contact technical support below. |
For free technical support, please call us at 800-MELISSA ext. 4 (800-635-4772 ext. 4) or email us at tech@Melissa.com.
To purchase this product, contact Melissa sales department at 800-MELISSA ext. 3 (800-635-4772 ext. 3).