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.
Download and Installation
The recommended method for plugin installation is via our plug-in update site, http://www.obj-sys.com/eclipse. The steps involved vary slightly according to your version of Eclipse. For Eclipse 3.4, follow these steps:
- Select Help -> Software Updates -> Available Software > Add Site
- Enter our update site for the location: 'http://www.obj-sys.com/eclipse' and click 'Ok'
- Our site and its available plug-ins should appear in the list of Available Software
- Check 'ASN1C Compiler Tools' with the latest version and click 'Install'
- Click 'Finish'
This should cause the plug-in to be installed. Note that Eclipse will not be able
to use the new plugin until after it has
been restarted.
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
This installation method varies by version of Eclipse. First, unzip the file you downloaded; this will give you an asn1c folder. Beginning with Eclipse 3.4, there is a "dropins" folder in your Eclipse installation. The asn1c folder can be copied into the dropins folder. Prior to Eclipse 3.4, there is not a dropins folder, only the plugins and features folders. In this case, you need to copy the files from the asn1c/plugins and asn1c/features folders into the corresponding folders in your Eclipse installation. After the files are copied, start Eclipse.
Getting Started with the Plugin
Once installed, the path to the ASN1C compiler executable must be set. This is done as follows:
- Select Windows -> Preferences -> ASN1C Compiler
- In the compiler path box, enter the full path to the ASN1C compiler executable file (or use Browse)
- Click OK to exit the screen
A new project can now be created. We will use the ASN1C Java Employee program as a sample.
- Select File -> New -> Project...
- Under 'ASN1 Compiler Tools', select 'ASN1C Compiler Project Wizard'
- Set project name to 'Employee' and click 'Next'
- 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'.
- Select 'Java' as the application language in the first drop-down list box and click 'Next'.
- Under General Options, select BER encoding rules and make sure Encode and Decode function types are checked.
- On the second General Options page, select the Generate Sample Reader and Writer options.
- On the Java Code Generation Options page, select the 'Output code to module name dirs (-dirs)' option.
- On the final page, check the 'Launch ASN.1 Compiler on Finish' option.

