MATLAB: Do I receive a “Negative time” exit reason during third party Support package and MATLAB installations

MATLAB

Why do I receive a "Negative time" exit reason during third party Support package and MATLAB installations?

Best Answer

When trying to install some support packages for R2018b and below on a machine with Thai locale and region settings that follows "Buddhist" calendar instead of Gregorian, the following exception that occurs during 3p installation:
java.lang.IllegalArgumentException: Negative time
at java.io.File.setLastModified(File.java:1427)
at com.mathworks.instutil.FileIO.setModificationTime(FileIO.java:519)
at com.mathworks.instutil.FileIO.createFileFromStream(FileIO.java:167)
at com.mathworks.instutil.FileIO.createFileFromStream(FileIO.java:157)
at com.mathworks.install.archive.zip.commonscompress.ArchiveEntryExtractorImpl.extract(ArchiveEntryExtractorImpl.java:37)
The same exception occurs while installing MATLAB R2017b and earlier on the same environment.
In order to resolve this issue, set the regional settings to US before the installation to avoid the "Negative time" exception.