| title | Create a Java .jar File from Class Files |
|---|---|
| description | Package your class files into a .jar file when using SQL Server Language Extensions to execute Java code. |
| author | rwestMSFT |
| ms.author | randolphwest |
| ms.date | 08/28/2025 |
| ms.service | sql |
| ms.subservice | language-extensions |
| ms.topic | how-to |
| monikerRange | >=sql-server-ver15 || >=sql-server-linux-ver15 |
[!INCLUDE sqlserver2019-and-later]
Learn how to package your class files into a .jar file, when using SQL Server Language Extensions to execute Java code. We recommend you package your files.
To create a .jar from class files, navigate to the folder containing your class file and run this command:
jar -cf <MyJar.jar> *.classMake sure the path to jar.exe is part of the system path variable. Alternatively, specify the full path to jar which can be found under /bin in the JDK folder. For example:
C:\Users\MyUser\Desktop\jdk1.8.0_201\bin\jar -cf <MyJar.jar> *.class