**Source URL:** https://limited.veevavault.dev/quality/vault-toolbox/vs-code-extension/guides/vault-java-sdk-code

# Working with Vault Java SDK Code

Vault Toolbox provides tools to extract, deploy, and delete custom Vault Java SDK code directly from Visual Studio Code. This guide outlines how to use each of these tools.

## Extracting Vault Java SDK Code from Vault

Vault Toolbox can extract custom Vault Java SDK code from Vault, allowing you to review it prior to writing custom code.

<Aside type="caution">
Extracting Vault Java SDK code deletes any local `.java` file whose class no longer exists in Vault, so the folder always mirrors Vault exactly. The confirmation dialog warns you before this happens if local files already exist. Click **Change Location** in the dialog instead of **Extract** to choose a different folder first. A class that merely fails to download during a run is never deleted, since its absence from your folder doesn't mean it's absent from Vault.
</Aside>

To extract Vault Java SDK code from Vault:

<Steps>
1.  Select the **Vault Toolbox** icon in the lefthand panel.
2.  Select the **Actions** (<Icon name="ph:dots-three-outline" />) tab.
3.  Expand **Components** (<Icon name="ph:puzzle-piece" />) and select **Extract Java SDK Code from Vault** (<Icon name="ph:code" />).
4.  In the confirmation dialog, click **Extract**.
</Steps>

 

<Aside>
You must connect an environment before extracting. If no environment is connected, this action is disabled and Vault Toolbox prompts you to connect one first. See [Managing Environments](/quality/vault-toolbox/vs-code-extension/guides/managing-environments) to learn how to connect an environment.
</Aside>

Once the operation completes, you can access all extracted classes from the `vault-toolbox/sdk/<vaultId>` folder within your repository, organized as a Java package tree. If one or more classes fail to download, Vault Toolbox still writes the classes that succeeded and reports which failed so you can investigate.

## Deploying Vault Java SDK Code to Vault

To deploy Vault Java SDK code to Vault, right-click a `.java` file in the editor or the *Explorer* panel and select **Vault Toolbox > Deploy to Vault**.

<Aside type="caution">
You cannot deploy Vault Java SDK code directly to a production Vault. The change-controlled path to production is a VPK deploy; this action targets sandboxes only.
</Aside>

Vault Toolbox reports whether the deploy succeeded or failed in a notification, including a **View API Call** button that opens the [API History](/quality/vault-toolbox/vs-code-extension/guides/api-history) entry for the deploy.

<ThemeImage srcLight="/images/toolbox/vscode-extension/javasdk_deployment_light.png" srcDark="/images/toolbox/vscode-extension/javasdk_deployment_dark.png" alt="Vault Toolbox Visual Studio Code Extension Vault Java SDK Code Deployment" />

## Deleting Vault Java SDK Code from Vault

To delete Vault Java SDK code from Vault, right-click a `.java` file in the editor or the *Explorer* panel and select **Vault Toolbox > Delete from Vault**.

<Aside type="caution">
Deleting a class permanently removes it from Vault. You cannot delete Vault Java SDK code directly from a production Vault. This action targets sandbox environments only.
</Aside>

Vault Toolbox derives the class name automatically from the file's package declaration and file name, so you don't need to provide it yourself. A confirmation dialog shows the exact class name and target Vault before anything is sent.

Vault Toolbox reports whether the deletion succeeded or failed in a notification, including a **View API Call** button that opens the [API History](/quality/vault-toolbox/vs-code-extension/guides/api-history) entry for the deletion.

---

**Previous:** [Using the VQL Editor](/quality/vault-toolbox/vs-code-extension/guides/vql-editor)  
**Next:** [Working with MDL](/quality/vault-toolbox/vs-code-extension/guides/mdl)