ASN1C icon ASN1C Eclipse Plugin

Overview

The ASN1C Eclipse plugin allows editing, syntax checking and code generation of Java, C#, or C/C++ code within the Eclipse IDE environment using ASN1C. It is integrated with the Java perspective in such a way as to allow Java projects to be created directly from ASN.1 source code.

Note that the plugin is functional with Eclipse 4.6 (Neon) and later versions. Earlier versions of Eclipse are not supported.

Download and Installation

The recommended method for plugin installation is via our plug-in update site, https://www.obj-sys.com/eclipse. Follow these steps:

  1. Select Help -> Install New Software
  2. Enter our update site for the "Work with" location: 'https://www.obj-sys.com/eclipse'
  3. The available plug-ins should appear in the list
  4. Enable the checkbox next to "ASN.1 and XML Solutions" and click Next
  5. Click Next in the next page
  6. Select acceptance of the license terms and click Finish in the next page
  7. Click Yes to restart Eclipse

Alternatively, the plug-in can be downloaded as a .zip file and then installed. Click on the following link to download the file:

ASN1C Eclipse Plug-in .zip file

Follow these steps to install the plugin after downloading it:

  1. Select Help -> Install New Software
  2. Click the Add button
  3. Click the Archive button in the pop-up page
  4. Locate the downloaded zip file and select OK
  5. Enable the checkbox next to "ASN.1 and XML Solutions" and click Next
  6. Click Next in the next page
  7. Select acceptance of the license terms and click Finish in the next page
  8. Click Yes to restart Eclipse

Getting Started with the Plugin

Once installed, the path to the ASN1C compiler command-line executable must be set. This is done as follows:

  1. Select Windows -> Preferences -> ASN1C Compiler
  2. In the compiler path box, use Browse or enter the full path to the ASN1C compiler command-line executable file (i.e. asn1c/asn1c.exe, not acgui/acgui.exe)
  3. Click OK to exit the screen

A new project can now be created. We will use the ASN1C Java Employee program as a sample.

  1. Select Windows -> Preferences -> ASN1C Compiler
  2. Click the "Language" drop-down list and select 'Java' as the application language
  3. Click the "Select encoding rules" drop-down list and select the 'BER' option
  4. Click the "Select Function Types to be generated" drop-down list and check the 'Encode' and 'Decode' options
  5. Click the "Basic options" drop-down list and select the 'Generate sample reader program' and 'Generate sample writer program' options
  6. Click the "Java options" drop-down list and select the 'Output code to module name dirs (-dirs)' option
  7. Click OK to exit the preferences screen
  8. Select File -> New -> Project...
  9. Under 'ASN1 Compiler Tools', select 'ASN1C compiler Project' and click 'Next'
  10. Set project name to 'Employee' and click 'Next'
  11. ASN.1 files may now be added to the project using the 'Add file' button. Click this button and navigate to the ASN1C java/sample_ber/Employee directory and select employee.asn. Then click 'Next'.
  12. Click Next in the next page (Java Settings)
  13. On the final page (ASN1C compiler command), check the 'Launch ASN.1 Compiler on finish' option and click 'Finish'. The ASN1C compiler should now attempt to generate the Java files.