DCB Studio 3.1 Compilation Errors: tools.jar and Encoding Fix

David Krause13 min read
SiemensTIA PortalTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

DCB Studio 3.1 Compilation Errors: tools.jar and Encoding Fix

DCB Studio 3.1 is the Siemens engineering environment used to author Drive Control Blocks (DCB) that are subsequently compiled into SIMOTION-compatible libraries and SINAMICS add-on firmware. A successful build produces a .zip artifact in C:\SIEMENS\dcc\dcb\dcc_libs\gen_simotion\bin\umctpcfc\<library>\<target>\ that is then imported by SIMOTION SCOUT or the SINAMICS STARTER commissioning toolchain. When the build fails immediately after DCBgenTO.compileFB begins processing function blocks, the entire library export is aborted and downstream SIMOTION projects cannot be regenerated. This article documents the root cause and the field-proven fix for two related failures that frequently appear together: a missing tools.jar warning and a cascade of 'xxx' is not recognized as an internal or external command errors.

1. Problem Overview

The reported failure occurs when a developer installs DCB Studio 3.1 with a valid floating license, accepts the default project layout, and triggers a build of the supplied demo_lib example or any user library generated by the DCB Studio wizard. The Ant-based build pipeline DCBTool.antDCBgen.antDCBgenMain.ant terminates with BUILD FAILED before any output archive is produced. The console output in the Eclipse console window is dominated by three repeating patterns:

Unable to locate tools.jar. Expected to find it in C:\SIEMENS\DCBStudio\ide\lib\tools.jar
[echo] DCB Builder version: V3.1.0.0 (V62.28.00.00)
[echo] DCBgenTO.compileFB: processing function block: getstamp
[exec] 'et' is not recognized as an internal or external command,
[exec] operable program or batch file.
[exec] 'cho' is not recognized as an internal or external command,
[exec] operable program or batch file.
...
BUILD FAILED
C:\SIEMENS\dcc\dcb\dcc_tools\ant\DCBTool.ant:152: The following error occurred while executing this line:
C:\SIEMENS\dcc\dcb\dcc_tools\ant\DCBgen.ant:52: The following error occurred while executing this line:
C:\SIEMENS\dcc\dcb\dcc_tools\ant\DCBgenMain.ant:109: Warning: Could not find file C:\SIEMENS\dcc\dcb\dcc_libs\gen_simotion\bin\umctpcfc\demo_lib\simotion4_2\demo_libV1_0_simotion4_2.zip to copy.
Total time: 19 seconds

The build is aborted with no .zip archive written to gen_simotion\bin\umctpcfc. The downstream message Could not find file ... to copy is a secondary symptom — the file was never created because the build pipeline died inside DCBgenMain.ant at line 109, which is the copy/aggregate step. The primary fault is the truncated command fragments above it.

2. Affected Versions and Environment

Component Version confirmed Notes
DCB Studio V3.1.0.0 (Builder V62.28.00.00) Install base observed in failing reports
Eclipse Platform Bundled with DCB Studio Launcher is DCBStudio.exe
Java Runtime Bundled JRE 1.7 / 1.8 (varies by install) tools.jar must match the JDK that ships with the studio
Ant apache-ant\bin\ant.bat under dcc_tools Invoked by Eclipse External Tools configuration
OS Windows 7 / Windows 10 (32 and 64-bit) Non-Unicode language set to Chinese (zh-CN / zh-TW)
SIMOTION target Simotion 4.2 (build target) Default in the demo library

The same symptoms have been reproduced on projects migrated from DCB Studio V1.x and V2.x after they are imported into V3.1, as noted in the Siemens supplementary conditions document SINAMICS DCB Studio V3.1 Supplementary Conditions (Entry ID 109758533). Migration-induced exceptions during import can leave the workspace in an inconsistent state that later surfaces during compile.

3. Console Output Breakdown

Every line in the failure trace is diagnostic. Treat them as a layered signature rather than independent messages:

Console line Layer What it actually means
Unable to locate tools.jar. Expected to find it in C:\SIEMENS\DCBStudio\ide\lib\tools.jar Classpath The bundled JRE/JDK does not expose a tools.jar at the expected path. Ant compilation tasks cannot find sun.tools.javac.Main.
[echo] DCB Builder version: V3.1.0.0 (V62.28.00.00) Diagnostic Ant script started cleanly; the runtime itself is healthy.
[echo] DCBgenTO.compileFB: processing function block: getstamp Diagnostic The compileFB macro entered successfully. Function block enumeration works.
[exec] 'et' is not recognized as an internal or external command Exec layer Ant <exec> task is calling a binary whose name has been truncated — the first byte(s) of the executable name have been stripped by code-page conversion.
[exec] 'cho' is not recognized as an internal or external command Exec layer Same truncation, different binary. The fragments et, cho, f, em are the lower halves of set, echo, if, and rem respectively when the lead bytes are dropped.
BUILD FAILED ... DCBTool.ant:152 ... DCBgen.ant:52 ... DCBgenMain.ant:109 Termination Three nested Ant files failed in sequence; the leaf failure is at DCBgenMain.ant:109 where the unbuilt .zip was supposed to be copied.
Warning: Could not find file ... demo_libV1_0_simotion4_2.zip to copy. Secondary The copy step in DCBgenMain.ant cannot find an output because the upstream generator never produced one.
Diagnostic clue: The fragments et, cho, f, em are not random. They are the trailing characters of four standard Windows command interpreter reserved words — set, echo, if, rem. Each is missing its first one or two bytes. That pattern is the fingerprint of an OEM/ANSI-to-Unicode conversion loss, not a missing executable and not an Ant script defect.

4. Root Cause Analysis

The DCB Studio build invokes the Windows cmd.exe interpreter to run helper batch scripts (most notably the per-library generator mygenlib.bat) that contain a preamble such as:

@echo off
set DCC_BASEPATH=C:\SIEMENS
set DCC_SOURCE_LIBS=C:\SIEMENS\dcc\dcb\dcc_libs\user
rem build target: simotion4_2
if exist ...
echo DCB Builder version ...

When the Windows console code page is set to a Chinese code page (CP936 / GBK, CP950 / Big5) and the system's non-Unicode programs language in Control Panel → Region → Administrative → Language for non-Unicode programs is also Chinese, the cmd.exe that is launched by Ant's <exec> task can misinterpret the lead bytes of these ASCII tokens as part of a multi-byte sequence. The result is that Ant's <exec> resolves the token to a binary name that begins at byte 2 of the original word — producing exactly the truncated fragments et, cho, f, and em. cmd.exe then reports 'et' is not recognized as an internal or external command, operable program or batch file for each fragment, and the script aborts before any DCB generation logic runs.

This is reproducible by:

  1. Installing DCB Studio 3.1 on a workstation whose non-Unicode language is set to Chinese.
  2. Creating a fresh library with the DCB Studio wizard.
  3. Compiling with Simotion 4.2 as the active build target.

Setting non-Unicode programs language back to English (United States) forces cmd.exe and the Ant <exec> child processes to interpret the helper batch files under the OEM 437 / 1252 code pages, which preserves every byte of the ASCII tokens. Builds then complete in the documented 1–2 minute timeframe.

The tools.jar warning is a separate but co-occurring issue: the DCB Studio 3.1 distribution expects a full JDK (not a JRE) to be present at C:\SIEMENS\DCBStudio\ide\lib\tools.jar. If the installer was pointed at a runtime image that does not contain tools.jar (typical for a JRE), the Ant <javac> task falls back to internal compilation but emits the warning, and some custom Ant scripts that explicitly reference tools.jar will silently skip their introspection.

5. Solution 1 — Fix Windows Non-Unicode Language Settings

This is the primary field-proven fix. It corrects both the truncated-token cascade and any path encoding artifacts that affect the generated mygenlib.bat.

5.1 Prerequisites

  • Local administrator account on the engineering workstation.
  • DCB Studio 3.1 closed before changes are applied.
  • Ant scripts regenerated after the change (DCB Studio does this on the next build).

5.2 Step-by-step

  1. Open Control Panel → Clock and Region → Region.
    • On Windows 10 / 11: search for Region in the Start menu.
    • On Windows 7: Control Panel → Region and Language.
  2. Click the Administrative tab.
  3. Under Language for non-Unicode programs, click Change system locale….
  4. Select English (United States) from the dropdown.
  5. Tick Beta: Use Unicode UTF-8 for worldwide language support only if all your other Siemens tools (SCOUT, STARTER, TIA Portal) have been validated on UTF-8. For mixed-tool fleets, leave this unchecked and rely on the per-process OEM code page instead.
  6. Click OK, then Apply, then restart the workstation. A sign-out is not sufficient; kernel32.dll caches the system locale for non-Unicode processes at boot.
  7. After reboot, verify the active code page from cmd.exe:
    chcp
    Active code page: 437
  8. Launch DCB Studio 3.1 and trigger a clean build on demo_lib for the Simotion 4.2 target.

5.3 Verification

  • The console must show [echo] DCB Builder version: V3.1.0.0 (V62.28.00.00) followed by successful [exec] invocations — no 'et' is not recognized messages.
  • The build must complete with BUILD SUCCESSFUL and Total time between 1 and 3 minutes.
  • The output archive must exist: C:\SIEMENS\dcc\dcb\dcc_libs\gen_simotion\bin\umctpcfc\demo_lib\simotion4_2\demo_libV1_0_simotion4_2.zip.
Why a reboot is mandatory: The non-Unicode language preference is read from the registry at HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage\ACP during kernel32!BasepProcessConsoleHostParameters initialization. Changing the value via the Control Panel UI updates the registry but does not invalidate the cached value in already-loaded processes, including any Eclipse javaw.exe that DCB Studio started before the change.

6. Solution 2 — Compile Library Instead of Project

If the Windows locale change is operationally blocked (for example, on a shared engineering host running a Chinese-localized HMI), an alternative workflow reliably bypasses the failing build target while you escalate the locale ticket. This workaround is supplied by Siemens engineering support for parallel use:

  1. In the DCB Studio Project Explorer, right-click the library (for example, demo_lib or my_lib).
  2. Choose Activate for Debugging. This forces the DCB Studio generator to materialize the helper script C:\SIEMENS\dcc\dcb\dcc_libs\gen_simotion\umctpcfc\<library_name>\mygenlib.bat.
  3. Right-click the library again and choose Build Configurations → Set Active → Simotion (Build Target). This selects the SIMOTION 4.2 codegen profile as the active compiler target.
  4. Right-click the library once more and choose Build Selected Library. Ant now invokes mygenlib.bat directly, which sidesteps the Eclipse-driven build target that triggers the truncated-token cascade.
  5. Wait for the console to report BUILD SUCCESSFUL. The output archive is written to the same gen_simotion\bin\umctpcfc\<library>\simotion4_2\ folder as the project-level build.

6.1 Verification

  • Confirm mygenlib.bat exists under gen_simotion\umctpcfc\<library>\ after step 2.
  • Confirm the generated .zip matches the expected naming pattern: <library>V<major>_<minor>_<target>.zip.
  • Import the .zip into SIMOTION SCOUT under Options → DCB Libraries; the DCB types should appear in the technology object library list.

7. tools.jar Resolution

The Unable to locate tools.jar warning is not always fatal — Ant's <javac> falls back to internal compilation when the JDK is missing — but it must be cleared to prevent silent drift in custom Ant tasks that introspect sun.tools.javac.Main.

Symptom Likely cause Fix
tools.jar missing under C:\SIEMENS\DCBStudio\ide\lib\ Installer pointed at a JRE Re-run setup and select a full JDK as the target VM; or copy tools.jar from <JDK_HOME>\lib\tools.jar into C:\SIEMENS\DCBStudio\ide\lib\
tools.jar present but ignored Ant launched with wrong JAVA_HOME Edit DCBStudio.ini / DCBStudio.bat to point at the JDK root that contains lib\tools.jar
tools.jar version mismatch with running JRE Mixed JRE/JDK install Verify java -version matches the JDK that supplies tools.jar
tools.jar found but sun.tools.javac.Main ClassNotFoundException Modular JDK 9+ where tools.jar is empty Pin DCB Studio to a JDK 8 (1.8.0_xxx) install; DCB Studio V3.1 is not validated on JDK 9+

7.1 Force a known JDK

Add the following two lines at the top of C:\SIEMENS\DCBStudio\DCBStudio.bat (or the equivalent -vm argument in DCBStudio.ini):

set JAVA_HOME=C:\Program Files\Java\jdk1.8.0_281
set PATH=%JAVA_HOME%\bin;%PATH%

Confirm before launching:

C:\SIEMENS\DCBStudio> %JAVA_HOME%\bin\java -version
java version "1.8.0_281"
Java(TM) SE Runtime Environment (build 1.8.0_281-b09)

C:\SIEMENS\DCBStudio> if exist %JAVA_HOME%\lib\tools.jar (echo tools.jar OK) else (echo MISSING)

8. Path Encoding Considerations

DCB Studio V3.1 also documents several supplementary conditions around path encoding and project import, summarized in the SINAMICS DCB Studio V3.1 Supplementary Conditions PDF. The items most relevant to the failure described here:

  • Project names and folder names must use ASCII characters only. Names containing CJK characters in dcc_libs\user\<project> are not supported and produce the same encoding-related failures.
  • The install root C:\SIEMENS must be writable by the build user. If the install root is on a redirected drive or under Program Files (x86), the generated .bat helpers may inherit a Unicode path that breaks the Ant <exec> task.
  • Projects migrated from DCB Studio V1.x or V2.x must be re-imported via the V3.1 importer rather than copied at the filesystem level. Silent legacy tags (notably .dccproj markers and build.properties paths) survive copy operations and re-introduce code-page-specific paths.
  • Floating license checkout can interleave with the build; the warning Could not find file ... to copy is sometimes a symptom of the license server dropping the checkout mid-build. Re-run Build Selected Library after the license is re-acquired.

9. Verification Checklist

Run the following checks before escalating to Siemens support. Each is non-destructive and takes under two minutes.

# Check Expected
1 chcp in cmd.exe Active code page: 437 or 1252
2 java -version 1.8.0_xxx (matches JAVA_HOME)
3 if exist %JAVA_HOME%\lib\tools.jar tools.jar OK
4 Path under dcc_libs\user ASCII characters only
5 Install root C:\SIEMENS, writable
6 mygenlib.bat regenerated Timestamp > build start time
7 Output .zip present <lib>V<v>_<target>.zip in gen_simotion\bin\umctpcfc\<lib>\<target>\
8 Floating license Checkout stable for the full build duration
9 Build target Simotion (Build Target) active for the library
10 Console final line BUILD SUCCESSFUL + Total time

10. Troubleshooting Matrix

Symptom Root cause Resolution
'et' is not recognized as an internal or external command Non-Unicode language set to Chinese Switch to English (US), reboot, rebuild
'cho' is not recognized Same encoding root cause Same fix
Unable to locate tools.jar JRE install, not JDK Install or point to JDK 8 with tools.jar
Could not find file ... to copy Upstream generator failed Resolve the upstream root cause; this is secondary
Build succeeds for one library, fails for another Library name contains CJK characters or non-ASCII path Rename library to ASCII; rebuild
Build fails after importing V1.x / V2.x project Legacy tags survived copy Re-import via V3.1 importer; see supplementary conditions PDF
BUILD FAILED with floating license intermittent License server drops checkout Reduce build parallelism; verify license server uptime
Build hangs at compileFB: processing function block Function block name contains characters outside ASCII Rename FB to ASCII; rebuild
sun.tools.javac.Main ClassNotFoundException JDK 9+ with empty tools.jar Pin to JDK 8; DCB Studio V3.1 is not validated on JDK 9+
mygenlib.bat not generated Activate for Debugging not performed Right-click library → Activate for Debugging first

11. Prevention and Long-Term Hardening

  • Standardize the engineering workstation image with non-Unicode programs language set to English (United States) and the system locale to en-US. Document this in the site commissioning standard so that any new DCB Studio host is provisioned identically.
  • Maintain a single supported JDK version (1.8.0_xxx) and verify tools.jar presence as part of the host acceptance test.
  • Use only ASCII characters in library names, function block names, and folder names under dcc_libs\user\. Add a pre-build lint script that aborts the build with a clear error if a non-ASCII character is detected.
  • Capture the build console output to a log file (tee wrapper or > %DCC_LOG%.log 2>&1) so that the exact truncation pattern can be diagnosed even after the Eclipse console buffer rolls.
  • Subscribe to Siemens ProductCERT and the SIMOTION / DCB Studio release notes feed for V3.1 patches that address the encoding supplementary conditions.
Safety note: DCB libraries generated for SIMOTION are deployed to safety-relevant motion controllers and SINAMICS drives. Never modify a generated .zip by hand, and never run an unverified .zip on a production machine. Always validate DCB types in a SIMOTION SCOUT offline simulation before field deployment.

FAQ

Why does DCB Studio 3.1 fail with 'et' is not recognized as an internal or external command?

The Windows command interpreter launched by Ant's <exec> task is dropping the lead byte(s) of standard CMD tokens such as set, echo, if, and rem because the non-Unicode programs language is set to Chinese. Set Language for non-Unicode programs to English (United States) in Control Panel → Region → Administrative, reboot, then rebuild.

How do I fix the 'Unable to locate tools.jar' warning in DCB Studio 3.1?

The warning indicates that the bundled JRE/JDK is missing tools.jar at C:\SIEMENS\DCBStudio\ide\lib\tools.jar. Install a full JDK 1.8.0_xxx, copy tools.jar from <JDK_HOME>\lib\tools.jar into DCBStudio\ide\lib\, or set JAVA_HOME in DCBStudio.bat to point at a JDK with the file present.

Can I compile a library in DCB Studio 3.1 without changing Windows locale?

Yes. Right-click the library, choose Activate for Debugging, set Simotion (Build Target) as the active build configuration, then choose Build Selected Library. This generates mygenlib.bat and runs the build outside the project-level pipeline that triggers the encoding cascade.

Where should the output .zip be located after a successful DCB Studio build?

The output archive is written to C:\SIEMENS\dcc\dcb\dcc_libs\gen_simotion\bin\umctpcfc\<library>\<target>\<library>V<v>_<target>.zip, for example demo_lib\simotion4_2\demo_libV1_0_simotion4_2.zip. Confirm the file exists before importing into SIMOTION SCOUT.

Are projects migrated from DCB Studio V1.x or V2.x affected by this error?

Yes. Imported V1.x/V2.x projects can carry legacy tags and non-ASCII paths that re-trigger the encoding cascade in V3.1. Re-import through the V3.1 importer rather than copying the workspace, and review the supplementary conditions in the SINAMICS DCB Studio V3.1 Supplementary Conditions document for the full list of V3.1 migration constraints.

Back to blog