<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://drfits.com/feed.xml" rel="self" type="application/atom+xml"/><link href="https://drfits.com/" rel="alternate" type="text/html"/><updated>2026-04-19T00:24:56+00:00</updated><id>https://drfits.com/feed.xml</id><title type="html">DevLog</title><subtitle>Thoughts on code, systems, and the craft of engineering.</subtitle><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><entry><title type="html">AEM Dialog with extraClientlibs – Do Not Shoot Yourself in the Foot</title><link href="https://drfits.com/2021/02/11/aem-dialog-with-extraclientlibs-do-not-shot-yourself-in-the-foot/" rel="alternate" type="text/html" title="AEM Dialog with extraClientlibs – Do Not Shoot Yourself in the Foot"/><published>2021-02-11T00:00:00+00:00</published><updated>2021-02-11T00:00:00+00:00</updated><id>https://drfits.com/2021/02/11/aem-dialog-with-extraclientlibs-do-not-shot-yourself-in-the-foot</id><content type="html" xml:base="https://drfits.com/2021/02/11/aem-dialog-with-extraclientlibs-do-not-shot-yourself-in-the-foot/"><![CDATA[<p>The post addresses common pitfalls when extending AEM component dialogs with custom JavaScript code. As projects scale and multiple components accumulate, complexity grows and custom JS can break logic in other dialogs.</p> <blockquote> <p>“Every custom include of ‘extraClientlibs’ will live on the page until page reload therefore JS functions could easily break logic in other dialogs during the page editing.”</p> </blockquote> <h2 id="1-avoid-including-everything-in-cqauthoringdialog">1. Avoid Including Everything in cq.authoring.dialog</h2> <p>The <code class="language-plaintext highlighter-rouge">cq.authoring.dialog</code> category should reserve space only for utility methods applicable across all dialogs without causing conflicts.</p> <h2 id="2-use-separate-descriptive-categories">2. Use Separate, Descriptive Categories</h2> <p>Create distinct categories using package or folder paths to prevent name collisions:</p> <div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre><span class="nx">categories</span><span class="o">=</span><span class="dl">"</span><span class="s2">[project-a.components.product.wizzard.authoring]</span><span class="dl">"</span>
</pre></td></tr></tbody></table></code></pre></div></div> <h2 id="3-add-dialog-validation-logic">3. Add Dialog Validation Logic</h2> <p>Implement resource type verification at the beginning of custom JS to ensure code executes only in the intended dialog:</p> <div class="language-javascript highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="rouge-code"><pre><span class="p">(</span><span class="nf">function </span><span class="p">(</span><span class="nb">document</span><span class="p">,</span> <span class="nx">$</span><span class="p">)</span> <span class="p">{</span>
  <span class="dl">"</span><span class="s2">use strict</span><span class="dl">"</span><span class="p">;</span>
  
  <span class="kd">const</span> <span class="nx">DIALOG_RESOURCE_TYPE</span> <span class="o">=</span> <span class="dl">"</span><span class="s2">project-a/components/product/wizzard</span><span class="dl">"</span><span class="p">;</span>
  
  <span class="kd">function</span> <span class="nf">isTargetDialog</span><span class="p">(</span><span class="nx">$formElement</span><span class="p">,</span> <span class="nx">dlgResourceType</span><span class="p">)</span> <span class="p">{</span>
    <span class="kd">const</span> <span class="nx">resourceType</span> <span class="o">=</span> <span class="nx">$formElement</span><span class="p">.</span><span class="nf">find</span><span class="p">(</span><span class="dl">"</span><span class="s2">input[name='./sling:resourceType']</span><span class="dl">"</span><span class="p">).</span><span class="nf">val</span><span class="p">();</span>
    <span class="k">return</span> <span class="nx">resourceType</span> <span class="o">===</span> <span class="nx">dlgResourceType</span><span class="p">;</span>
  <span class="p">}</span>
  
  <span class="nf">$</span><span class="p">(</span><span class="nb">document</span><span class="p">).</span><span class="nf">on</span><span class="p">(</span><span class="dl">"</span><span class="s2">dialog-ready</span><span class="dl">"</span><span class="p">,</span> <span class="nf">function </span><span class="p">()</span> <span class="p">{</span>
    <span class="kd">const</span> <span class="nx">$formElement</span> <span class="o">=</span> <span class="nf">$</span><span class="p">(</span><span class="k">this</span><span class="p">).</span><span class="nf">find</span><span class="p">(</span><span class="dl">'</span><span class="s1">coral-dialog form.foundation-form</span><span class="dl">'</span><span class="p">);</span>
    <span class="k">if </span><span class="p">(</span><span class="o">!</span><span class="nf">isTargetDialog</span><span class="p">(</span><span class="nx">$formElement</span><span class="p">,</span> <span class="nx">DIALOG_RESOURCE_TYPE</span><span class="p">))</span> <span class="p">{</span>
      <span class="nx">console</span><span class="p">.</span><span class="nf">debug</span><span class="p">(</span><span class="dl">"</span><span class="s2">Skip the listener, not a </span><span class="dl">"</span><span class="p">,</span> <span class="nx">DIALOG_RESOURCE_TYPE</span><span class="p">,</span> <span class="dl">"</span><span class="s2"> dialog.</span><span class="dl">"</span><span class="p">);</span>
      <span class="k">return</span><span class="p">;</span>
    <span class="p">}</span>
    <span class="c1">// Implementation code here</span>
  <span class="p">});</span>
<span class="p">})(</span><span class="nb">document</span><span class="p">,</span> <span class="nx">Granite</span><span class="p">.</span><span class="nx">$</span><span class="p">);</span>
</pre></td></tr></tbody></table></code></pre></div></div> <p>These practices promote maintainable, scalable dialog implementations across growing AEM projects.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><category term="javascript"/><summary type="html"><![CDATA[Steps to avoid common mistakes during implementation of custom JS in AEM dialogs.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2021-02-11-aem-dialog-with-extraclientlibs-do-not-shot-yourself-in-the-foot/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2021-02-11-aem-dialog-with-extraclientlibs-do-not-shot-yourself-in-the-foot/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">OAK Query Aborted</title><link href="https://drfits.com/2020/06/11/oak-query-aborted/" rel="alternate" type="text/html" title="OAK Query Aborted"/><published>2020-06-11T00:00:00+00:00</published><updated>2020-06-11T00:00:00+00:00</updated><id>https://drfits.com/2020/06/11/oak-query-aborted</id><content type="html" xml:base="https://drfits.com/2020/06/11/oak-query-aborted/"><![CDATA[<p>Every Adobe Experience Manager developer encounters an exception indicating that the node reading limit has been exceeded:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="rouge-code"><pre>java.lang.UnsupportedOperationException: The query read or traversed more than 100000 nodes. 
To avoid affecting other tasks, processing was stopped.
	at org.apache.jackrabbit.oak.query.FilterIterators.checkReadLimit(FilterIterators.java:70)
	at org.apache.jackrabbit.oak.plugins.index.Cursors.checkReadLimit(Cursors.java:67)
	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$LucenePathCursor$1.next(LucenePropertyIndex.java:1730)
	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$LucenePathCursor$1.next(LucenePropertyIndex.java:1711)
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:646)
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
	at org.apache.jackrabbit.oak.plugins.index.Cursors$PathCursor.hasNext(Cursors.java:216)
	at org.apache.jackrabbit.oak.plugins.index.lucene.LucenePropertyIndex$LucenePathCursor.hasNext(LucenePropertyIndex.java:1751)
	at org.apache.jackrabbit.oak.query.ast.SelectorImpl.next(SelectorImpl.java:432)
	at org.apache.jackrabbit.oak.query.QueryImpl$RowIterator.fetchNext(QueryImpl.java:824)
	at org.apache.jackrabbit.oak.query.QueryImpl$RowIterator.hasNext(QueryImpl.java:851)
	at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl$1.fetch(QueryResultImpl.java:98)
</pre></td></tr></tbody></table></code></pre></div></div> <h2 id="solutions">Solutions</h2> <p>In this situation, developers can:</p> <ul> <li>Define an Oak index for the query</li> <li>Redesign repository taxonomy or structure for improvement</li> <li>Update Oak indexes to cover the query</li> <li>Use <code class="language-plaintext highlighter-rouge">oak:Unstructured</code> instead of <code class="language-plaintext highlighter-rouge">nt:unstructured</code> and <code class="language-plaintext highlighter-rouge">sling:Folder</code> instead of <code class="language-plaintext highlighter-rouge">sling:OrderedFolder</code> when ordering is not required</li> <li>Consider other architectural approaches</li> </ul> <h2 id="development-workaround">Development Workaround</h2> <p>During development, you can temporarily increase <code class="language-plaintext highlighter-rouge">LimitReads</code> and <code class="language-plaintext highlighter-rouge">LimitInMemory</code> parameters:</p> <ol> <li>Navigate to QueryEngineSettings at <code class="language-plaintext highlighter-rouge">http://localhost:4502/system/console/jmx/org.apache.jackrabbit.oak%3Aname%3Dsettings%2Ctype%3DQueryEngineSettings</code></li> <li>Increase the selected parameters</li> </ol> <p><strong>Note:</strong> This is for development only; do not deploy to production.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><category term="apache-oak"/><summary type="html"><![CDATA[Addressing the OAK query node read limit exceeded error and solutions.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2020-06-11-oak-query-aborted/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2020-06-11-oak-query-aborted/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">AEM Digital Assets Installation</title><link href="https://drfits.com/2020/03/16/aem-digital-assets-installation/" rel="alternate" type="text/html" title="AEM Digital Assets Installation"/><published>2020-03-16T00:00:00+00:00</published><updated>2020-03-16T00:00:00+00:00</updated><id>https://drfits.com/2020/03/16/aem-digital-assets-installation</id><content type="html" xml:base="https://drfits.com/2020/03/16/aem-digital-assets-installation/"><![CDATA[<p>There is a common case when installation of digital assets on AEM becomes necessary. The most straightforward approach involves creating a package containing the required assets and deploying it through AEM’s package manager.</p> <p>The following steps enable this process:</p> <ol> <li>Create a package with digital assets and deploy to AEM package manager</li> <li>Stop the <code class="language-plaintext highlighter-rouge">com.day.cq.workflow.launcher.impl.WorkflowLauncherImpl</code> — this prevents getting stuck on rendition workflow</li> <li>Install the package from step 1</li> <li>Start the <code class="language-plaintext highlighter-rouge">com.day.cq.workflow.launcher.impl.WorkflowLauncherImpl</code></li> </ol> <p>These steps allow importing assets on AEM quickly with renditions.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><summary type="html"><![CDATA[Quick installation process for digital assets in AEM with renditions.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2020-03-16-aem-digital-assets-installation/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2020-03-16-aem-digital-assets-installation/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">Find Out AEM Product Version</title><link href="https://drfits.com/2020/02/28/find-out-aem-product-version/" rel="alternate" type="text/html" title="Find Out AEM Product Version"/><published>2020-02-28T00:00:00+00:00</published><updated>2020-02-28T00:00:00+00:00</updated><id>https://drfits.com/2020/02/28/find-out-aem-product-version</id><content type="html" xml:base="https://drfits.com/2020/02/28/find-out-aem-product-version/"><![CDATA[<p>To find the Adobe Experience Manager product version, navigate to the system console’s product information page:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>http://localhost:4502/system/console/status-productinfo
</pre></td></tr></tbody></table></code></pre></div></div> <p>This endpoint displays the installed AEM product version details for the running instance.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><summary type="html"><![CDATA[URL to identify AEM product version.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2020-02-28-find-out-aem-product-version/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2020-02-28-find-out-aem-product-version/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">Enable AEM Javadoc Hints</title><link href="https://drfits.com/2020/02/12/enable-aem-javadoc-hints/" rel="alternate" type="text/html" title="Enable AEM Javadoc Hints"/><published>2020-02-12T00:00:00+00:00</published><updated>2020-02-12T00:00:00+00:00</updated><id>https://drfits.com/2020/02/12/enable-aem-javadoc-hints</id><content type="html" xml:base="https://drfits.com/2020/02/12/enable-aem-javadoc-hints/"><![CDATA[<p>To consume the whole power of IDE we must use Javadoc hints. Below is a short how-to on how to enable these hints for AEM 6.4:</p> <ol> <li> <p>Open <strong>Project structure</strong> (shortcut on Windows: <code class="language-plaintext highlighter-rouge">Ctrl + Alt + Shift + S</code>)</p> </li> <li> <p>Find <code class="language-plaintext highlighter-rouge">Maven: com.adobe.aem:uber-jar:apis:6.4.4</code> (or another uber jar which you are using for the project) and click the plus icon with the Earth</p> </li> <li> <p>Put the following as a documentation URL:</p> </li> </ol> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>https://helpx.adobe.com/experience-manager/6-4/sites/developing/using/reference-materials/javadoc/index.html
</pre></td></tr></tbody></table></code></pre></div></div> <p>After completing these actions you’ll be able to see API doc hints (on Windows with <code class="language-plaintext highlighter-rouge">Ctrl + Q</code>).</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><category term="intellij"/><summary type="html"><![CDATA[How-to guide for enabling Javadoc hints in IDE for AEM development.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2020-02-12-enable-aem-javadoc-hints/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2020-02-12-enable-aem-javadoc-hints/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">How to Install Printer HP 1018 in Windows 10</title><link href="https://drfits.com/2020/01/17/how-to-install-printer-hp-1018-in-windows-10/" rel="alternate" type="text/html" title="How to Install Printer HP 1018 in Windows 10"/><published>2020-01-17T00:00:00+00:00</published><updated>2020-01-17T00:00:00+00:00</updated><id>https://drfits.com/2020/01/17/how-to-install-printer-hp-1018-in-windows-10</id><content type="html" xml:base="https://drfits.com/2020/01/17/how-to-install-printer-hp-1018-in-windows-10/"><![CDATA[<p>Printer installation on Windows 10 usually happens automatically, but it’s also possible to do it manually when Windows is unable to identify the printer.</p> <h2 id="installation-steps">Installation Steps</h2> <ol> <li><strong>Open Print Server Properties</strong> <ul> <li>Press <code class="language-plaintext highlighter-rouge">Win + R</code></li> <li>Enter <code class="language-plaintext highlighter-rouge">printui /s /t2</code></li> <li>Click OK</li> </ul> </li> <li><strong>Add Printer</strong> <ul> <li>Click “Add…” in the Printer Server Properties window</li> <li>Follow the subsequent dialog prompts</li> </ul> </li> <li><strong>Select Driver</strong> <ul> <li>In the Windows Update window, select manufacturer: <strong>HP</strong></li> <li>Choose driver: <strong>HP LaserJet 1020</strong></li> <li>Click “Next” then “Finish”</li> </ul> </li> </ol> <p>Upon completing these steps, the HP 1018 printer will be installed on the system.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="windows"/><summary type="html"><![CDATA[Manual printer installation steps for Windows 10 when auto-detection fails.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2020-01-17-how-to-install-printer-hp-1018-in-windows-10/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2020-01-17-how-to-install-printer-hp-1018-in-windows-10/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">Fix Java Windows Registry Warning</title><link href="https://drfits.com/2018/09/26/fix-java-warnings/" rel="alternate" type="text/html" title="Fix Java Windows Registry Warning"/><published>2018-09-26T00:00:00+00:00</published><updated>2018-09-26T00:00:00+00:00</updated><id>https://drfits.com/2018/09/26/fix-java-warnings</id><content type="html" xml:base="https://drfits.com/2018/09/26/fix-java-warnings/"><![CDATA[<p>When executing Java code that communicates with the Windows machine — particularly when using the find-bugs Maven plugin or IntelliJ IDEA — you may encounter the following warning:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>WARNING: Could not open/create prefs root node Software\JavaSoft\Prefs at root 0x80000002. Windows RegCreateKeyEx(…) returned error code 5.
</pre></td></tr></tbody></table></code></pre></div></div> <h2 id="solution">Solution</h2> <p>Create two registry keys:</p> <ul> <li><code class="language-plaintext highlighter-rouge">HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Prefs</code></li> <li><code class="language-plaintext highlighter-rouge">HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\JavaSoft\Prefs</code></li> </ul> <h2 id="steps-to-fix">Steps to Fix</h2> <ol> <li>Open the Registry Editor (<code class="language-plaintext highlighter-rouge">Win + R</code> → type <code class="language-plaintext highlighter-rouge">regedit</code> → Enter)</li> <li>Navigate to <code class="language-plaintext highlighter-rouge">Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node</code></li> <li>Right-click on <code class="language-plaintext highlighter-rouge">WOW6432Node</code>, select <strong>New → Key</strong> and name it <strong>JavaSoft</strong></li> <li>Create a <strong>Prefs</strong> key within JavaSoft</li> <li>Repeat steps 3–4 for the <code class="language-plaintext highlighter-rouge">HKEY_LOCAL_MACHINE\SOFTWARE</code> path</li> </ol>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="java"/><category term="windows"/><summary type="html"><![CDATA[Resolving Windows Java preferences registry warnings when running Java tools.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2018-09-26-fix-java-warnings/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2018-09-26-fix-java-warnings/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">Find Out AEM Information</title><link href="https://drfits.com/2018/09/22/find-out-aem-information/" rel="alternate" type="text/html" title="Find Out AEM Information"/><published>2018-09-22T00:00:00+00:00</published><updated>2018-09-22T00:00:00+00:00</updated><id>https://drfits.com/2018/09/22/find-out-aem-information</id><content type="html" xml:base="https://drfits.com/2018/09/22/find-out-aem-information/"><![CDATA[<p>Quick reference for locating AEM system information through specific URLs:</p> <p><strong>Installed AEM Version:</strong></p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>http://localhost:4502/system/console/status-productinfo
</pre></td></tr></tbody></table></code></pre></div></div> <p><strong>AEM Run Mode:</strong></p> <p>Navigate to:</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>http://localhost:4502/system/console/bundles
</pre></td></tr></tbody></table></code></pre></div></div> <p>Then go to <strong>Status → Sling Settings</strong> menu.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><summary type="html"><![CDATA[Quick links to AEM version and run mode configuration information.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2018-09-22-find-out-aem-information/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2018-09-22-find-out-aem-information/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">AEM Start Script for Developers</title><link href="https://drfits.com/2018/09/07/aem-start-script-for-developers/" rel="alternate" type="text/html" title="AEM Start Script for Developers"/><published>2018-09-07T00:00:00+00:00</published><updated>2018-09-07T00:00:00+00:00</updated><id>https://drfits.com/2018/09/07/aem-start-script-for-developers</id><content type="html" xml:base="https://drfits.com/2018/09/07/aem-start-script-for-developers/"><![CDATA[<p>Navigating to the <code class="language-plaintext highlighter-rouge">crx-quickstart</code> folder to clean logs and restart AEM instances every time is tedious. Below are automation scripts for both Windows and macOS.</p> <p>Place either script at the same directory level as <code class="language-plaintext highlighter-rouge">license.properties</code>.</p> <h2 id="windows-startbat">Windows (start.bat)</h2> <div class="language-batch highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
</pre></td><td class="rouge-code"><pre><span class="nb">del</span> <span class="na">/s /q </span><span class="s2">".\crx-quickstart\logs\*.*"</span>

<span class="kd">set</span> <span class="kd">CQ_PORT</span><span class="o">=</span><span class="m">4502</span>
<span class="kd">set</span> <span class="kd">CQ_RUNMODE</span><span class="o">=</span><span class="kd">author</span><span class="o">,</span><span class="kd">localdev</span>
<span class="kd">set</span> <span class="kd">CQ_JVM_OPTS</span><span class="o">=</span><span class="na">-Xmx</span><span class="m">2048</span><span class="kd">m</span> <span class="na">-XX</span>:<span class="na">+UseG</span><span class="m">1</span><span class="kd">GC</span> <span class="na">-XX</span>:<span class="na">-UseGCOverheadLimit -Duser</span>.language<span class="o">=</span><span class="kd">en</span> <span class="na">-Duser</span>.region<span class="o">=</span><span class="kd">US</span> <span class="na">-Duser</span>.timezone<span class="o">=</span><span class="kd">UTC</span> <span class="na">-Djava</span>.awt.headless<span class="o">=</span><span class="kd">true</span> <span class="na">-Dfile</span>.encoding<span class="o">=</span><span class="kd">UTF</span><span class="o">-</span><span class="m">8</span> <span class="na">-agentlib</span><span class="nl">:jdwp</span><span class="o">=</span><span class="kd">transport</span><span class="o">=</span><span class="kd">dt_socket</span><span class="o">,</span><span class="kd">server</span><span class="o">=</span><span class="kd">y</span><span class="o">,</span><span class="kd">suspend</span><span class="o">=</span><span class="kd">n</span><span class="o">,</span><span class="kd">address</span><span class="o">=</span><span class="m">8001</span>

<span class="nb">cd</span> ./crx<span class="na">-quickstart/bin
</span><span class="k">call</span> ./start.bat
</pre></td></tr></tbody></table></code></pre></div></div> <h2 id="macos">macOS</h2> <div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="rouge-code"><pre><span class="c">#!/bin/sh</span>

<span class="nb">echo</span> <span class="s2">"Clean AEM logs"</span>
find crx-quickstart/logs/ <span class="nt">-type</span> f <span class="nt">-delete</span>

<span class="nb">echo</span> <span class="s2">"Set AEM parameters"</span>
<span class="nb">export </span><span class="nv">CQ_PORT</span><span class="o">=</span><span class="s2">"4502"</span>
<span class="nb">export </span><span class="nv">CQ_DEBUG_OPTS</span><span class="o">=</span><span class="s2">"-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8001"</span>
<span class="nb">export </span><span class="nv">CQ_LOCALE_OPTS</span><span class="o">=</span><span class="s2">"-Duser.language=en -Duser.region=US -Duser.timezone=UTC -Dfile.encoding=UTF-8"</span>
<span class="nb">export </span><span class="nv">CQ_RUNMODE</span><span class="o">=</span><span class="s2">"author,nosamplecontent"</span>
<span class="nb">export </span><span class="nv">CQ_JVM_OPTS</span><span class="o">=</span><span class="s2">"-Djava.awt.headless=true -Xmx2048m -XX:+UseG1GC -XX:-UseGCOverheadLimit </span><span class="nv">$CQ_LOCALE_OPTS</span><span class="s2"> </span><span class="nv">$CQ_DEBUG_OPTS</span><span class="s2">"</span>

<span class="nb">echo</span> <span class="s2">"Start AEM instance"</span>
crx-quickstart/bin/start <span class="s2">"</span><span class="nv">$@</span><span class="s2">"</span>
</pre></td></tr></tbody></table></code></pre></div></div>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="aem"/><summary type="html"><![CDATA[Developer scripts to automate AEM startup process on Windows and macOS.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2018-09-07-aem-start-script-for-developers/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2018-09-07-aem-start-script-for-developers/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry><entry><title type="html">How to Install Windows JDK Without Running the Installer</title><link href="https://drfits.com/2017/10/29/how-to-install-windows-jdk-without-installation/" rel="alternate" type="text/html" title="How to Install Windows JDK Without Running the Installer"/><published>2017-10-29T00:00:00+00:00</published><updated>2017-10-29T00:00:00+00:00</updated><id>https://drfits.com/2017/10/29/how-to-install-windows-jdk-without-installation</id><content type="html" xml:base="https://drfits.com/2017/10/29/how-to-install-windows-jdk-without-installation/"><![CDATA[<p>Sometimes we want to keep our system as clean as possible and avoid installing JDK from the <strong>exe</strong> installer. Here is a brief how-to:</p> <h2 id="steps">Steps</h2> <ol> <li> <p>Download JDK from the <a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">Oracle website</a></p> </li> <li> <p>Install <a href="http://www.7-zip.org/">7-zip</a> if not already installed</p> </li> <li> <p>Create an <code class="language-plaintext highlighter-rouge">unpack.bat</code> file in the same folder as the downloaded JDK installer, with content depending on the JDK version:</p> </li> </ol> <h3 id="batch-file-for-jdk-8">Batch file for JDK 8</h3> <div class="language-batch highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="rouge-code"><pre>@echo <span class="na">off</span>
<span class="kd">set</span> <span class="kd">PATH</span><span class="o">=</span><span class="nv">%PATH%</span><span class="o">;</span><span class="kd">C</span>:\Program <span class="kd">Files</span>\7<span class="na">-Zip</span>\

<span class="nb">rmdir</span> <span class="na">/s /q </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out"</span>
<span class="nb">rmdir</span> <span class="na">/s /q </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="m">7</span><span class="kd">z</span> <span class="kd">x</span> <span class="err">%</span><span class="m">1</span> <span class="na">-o</span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out"</span>
<span class="nb">cd</span> <span class="na">/d </span><span class="s2">"jdk-out\.rsrc\1033\JAVA_CAB10"</span>
<span class="kd">extrac32</span> <span class="m">111</span>
<span class="m">7</span><span class="kd">z</span> <span class="kd">x</span> <span class="kd">tools</span>.zip <span class="na">-ojdk
</span><span class="nb">cd</span> <span class="na">/d </span><span class="s2">"jdk"</span>
<span class="k">for</span> <span class="na">/r </span><span class="vm">%%x</span> <span class="k">in</span> <span class="o">(*</span>.pack<span class="o">)</span> <span class="k">do</span> .\bin\unpack200 <span class="na">-r </span><span class="s2">"</span><span class="vm">%%x</span><span class="s2">"</span> <span class="s2">"</span><span class="vm">%%~dx%%~px%%~nx</span><span class="s2">.jar"</span>
<span class="nb">mkdir</span> <span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="nb">xcopy</span> <span class="na">/s </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out\.rsrc\1033\JAVA_CAB10\jdk"</span> <span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="nb">cd</span> <span class="na">/d </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">"</span>
<span class="nb">cd</span> <span class="na">/d </span><span class="s2">"jdk-out\.rsrc\1033\JAVA_CAB9"</span>
<span class="kd">extrac32</span> <span class="m">110</span>
<span class="nb">xcopy</span> <span class="na">/s </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out\.rsrc\1033\JAVA_CAB9\src.zip"</span> <span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="nb">cd</span> <span class="na">/d </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">"</span>
<span class="nb">rmdir</span> <span class="na">/s /q </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out"</span>
</pre></td></tr></tbody></table></code></pre></div></div> <h3 id="batch-file-for-jdk-9">Batch file for JDK 9</h3> <div class="language-batch highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="rouge-code"><pre>@echo <span class="na">off</span>
<span class="kd">set</span> <span class="kd">PATH</span><span class="o">=</span><span class="nv">%PATH%</span><span class="o">;</span><span class="kd">C</span>:\Program <span class="kd">Files</span>\7<span class="na">-Zip</span>\

<span class="nb">rmdir</span> <span class="na">/s /q </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out"</span>
<span class="nb">rmdir</span> <span class="na">/s /q </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="m">7</span><span class="kd">z</span> <span class="kd">x</span> <span class="err">%</span><span class="m">1</span> <span class="na">-o</span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out"</span>
<span class="nb">cd</span> <span class="na">/d </span><span class="s2">"jdk-out"</span>
<span class="m">7</span><span class="kd">z</span> <span class="kd">x</span> <span class="kd">tools</span>.zip <span class="na">-ojdk
</span><span class="nb">cd</span> <span class="na">/d </span><span class="s2">"jdk"</span>
<span class="k">for</span> <span class="na">/r </span><span class="vm">%%x</span> <span class="k">in</span> <span class="o">(*</span>.pack<span class="o">)</span> <span class="k">do</span> .\bin\unpack200 <span class="na">-r </span><span class="s2">"</span><span class="vm">%%x</span><span class="s2">"</span> <span class="s2">"</span><span class="vm">%%~dx%%~px%%~nx</span><span class="s2">.jar"</span>
<span class="nb">mkdir</span> <span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="nb">xcopy</span> <span class="na">/s </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out\jdk"</span> <span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\unpacked-jdk"</span>
<span class="nb">cd</span> <span class="na">/d </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">"</span>
<span class="nb">rmdir</span> <span class="na">/s /q </span><span class="s2">"</span><span class="vm">%~dp0</span><span class="s2">\jdk-out"</span>
</pre></td></tr></tbody></table></code></pre></div></div> <ol> <li>Run the script from the command line with the installer filename as the parameter:</li> </ol> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>unpack jdk-8u152-windows-x64.exe
</pre></td></tr></tbody></table></code></pre></div></div> <p>or</p> <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code><table class="rouge-table"><tbody><tr><td class="rouge-gutter gl"><pre class="lineno">1
</pre></td><td class="rouge-code"><pre>unpack jdk-9.0.1_windows-x64_bin.exe
</pre></td></tr></tbody></table></code></pre></div></div> <p>After completing these steps, you will find an <strong>unpacked-jdk</strong> directory containing the extracted JDK files.</p>]]></content><author><name>Evgeniy Fitsner</name><email>drfits@drfits.com</email></author><category term="java"/><category term="windows"/><summary type="html"><![CDATA[Guide for unpacking JDK from exe installers using 7-zip to keep your system clean.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://drfits.com/assets/images/posts/2017-10-29-how-to-install-windows-jdk-without-installation/cover.webp"/><media:content medium="image" url="https://drfits.com/assets/images/posts/2017-10-29-how-to-install-windows-jdk-without-installation/cover.webp" xmlns:media="http://search.yahoo.com/mrss/"/></entry></feed>