How to Set Up the MagTek Universal Project
How to Set Up the Java Library With the JRE/JVM
To set up and run the Java Demo software using the 32-bit version of Java on either a 32-bit or 64-bit version of Windows, follow these steps:
Uninstall any existing instances of the Java Runtime Environment (JRE) or Java Development Kit (JDK). Leaving them installed can cause runtime failures, as the library may fail to load.
Download and install the latest version of the Java Runtime Environment (JRE) and Java Development Kit (JDK).
Download and Set Up the MagTek Universal Java Project. You may download and install it directly on the target workstation where it will be used, or you may opt to install it on a master development workstation and copy the dependencies to the target workstation manually.
If you opted to manually copy the MagTek Universal SDK for Java dependencies from a master development workstation to the target workstation where it will be used, follow these steps:
On the master workstation, navigate to the root of the MagTek Universal SDK for Java. By default, it will be ...\x86 for 32-bit operating systems, or ...\x64 for 64-bit operating systems.
Copy all the files to the target workstation’s c:\\Windows\system32 folder for x64 systems, or to the target workstation’s C:\Windows\SysWOW64 folder for x86 systems.
Connect a MagTek device to the workstation. Windows will install the device drivers automatically. Wait for Windows to report the driver installation is complete.
Launch a Windows command prompt as an Administrator.
cd to the root of the folders where the MTUSDK Java Demo is installed.
Type test.bat and press Enter to launch the Java Demo software.
How to Modify Manifest
The Caller-Allowable-Codebase attribute is used to identify the domains from which JavaScript code can make calls to your RIA without security prompts. Set this attribute to the domain that hosts the JavaScript code. If a call is made from JavaScript code that is not located in a domain specified by the Caller-Allowable-Codebase attribute, the call is blocked. To specify more than one domain, separate the domains by a space, for example:
Caller-Allowable-Codebase: *.yahoo.com *.google.com *.magtek.com *The Application-Library-Allowable-Codebase attribute identifies the locations where your signed RIA is expected to be found. This attribute is used to determine what is listed in the Location field for the security prompt that is shown to users when the JAR file for your RIA is in a different location than the JNLP file or HTML page that starts your RIA. If the files are not in the locations identified, the RIA is blocked. Set this attribute to the domains where the JAR file, JNLP file, and HTML page are located. To specify more than one domain, separate the domains by a space, for example:
For more information regarding the JAR File Manifest Attributes for Security, please visit this website http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/security/manifest.html
In order to modify the Manifest file, please follow these steps.
Find installation folder by default, the installation folder is: ...\Library
Launch the command prompt and extract the META-INF/MANIFEST.MF from the jar file.
Open MANIFEST.MF and look for the Caller-Allowable-Codebase and Application-Library-Allowable-Codebase and add your website URL to the list like the example above.
Update the manifest to the jar file.
How to Sign JAR
These instructions provide an overview of obtaining and using Sun Java signing and a digital certificate.
Make sure your machine has the latest Java JDK installed.
Generate a public/private key pair by entering the following command, specifying an alias for your keystore:
Generate a certificate signing request (CSR) by entering the following command:
After prompting you to enter the password for your keystore, keytool will generate a CSR.
Save the certificate received from the Certificate provider as Certname.p7b.
Import your Digital Certificate by entering the following command:
In this string, keytool is requested to import the Digital ID “Certname.cer” into the keystore MyCert.
Bundle your applet into a Java Application Resource (JAR) file by entering the following command:
Sign your applet by using jarsigner to sign the JAR file, using the private key you saved in your keystore:
Verify the output of your signed JAR file by entering the following command:
Please visit this website https://docs.oracle.com/javase/tutorial/deployment/jar/signing.html for more information regarding signing JAR files.
How to Set Up the SDK in Eclipse
To set up the MT Universal Java Libraries, download and install package from MagTek.com.
On the master workstation, navigate to the root of the MagTek Universal SDK for Java. By default, it will be …\Library .
In Eclipse, click File --> New --> Java Project
Type the project name
In the library tab, click Add external jar, then point to the Lib folder of the root folder of MagTek Universal SDK for Java to add the MTUSDK.jar.
Last updated

