Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

DeleteLexicon

Focus mode
DeleteLexicon - Amazon Polly

The following Java code sample show how to use Java-based applications to delete a specific lexicon stored in an AWS Region. A lexicon which has been deleted is not available for speech synthesis, nor can it be retrieved using either the GetLexicon or ListLexicon APIs.

For more information on this operation, see the reference for the DeleteLexicon API.

package com.amazonaws.polly.samples; import com.amazonaws.services.polly.AmazonPolly; import com.amazonaws.services.polly.AmazonPollyClientBuilder; import com.amazonaws.services.polly.model.DeleteLexiconRequest; public class DeleteLexiconSample { private String LEXICON_NAME = "SampleLexicon"; AmazonPolly client = AmazonPollyClientBuilder.defaultClient(); public void deleteLexicon() { DeleteLexiconRequest deleteLexiconRequest = new DeleteLexiconRequest().withName(LEXICON_NAME); try { client.deleteLexicon(deleteLexiconRequest); } catch (Exception e) { System.err.println("Exception caught: " + e); } } }
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.