免费转换 JAR 文件

专业的 JAR 文件转换工具

将您的文件拖放到这里

或点击浏览文件

最大文件大小:100MB
10M+ 已转换文件
100% 永久免费
256位 安全加密

支持的格式

以高质量在所有主要文件格式之间转换

常见格式

ZIP

ZIP Archive - universal compression format developed by Phil Katz (1989) supporting multiple compression methods. Built into Windows, macOS, and Linux. Uses DEFLATE algorithm providing good compression (40-60% reduction) with fast processing. Supports file encryption, split archives, and compression levels. Maximum compatibility across all platforms and devices. Perfect for file sharing, email attachments, web downloads, and general-purpose compression. Industry standard with virtually universal software support including built-in OS tools, mobile apps, and command-line utilities.

RAR

RAR Archive - proprietary format by Eugene Roshal (1993) offering superior compression ratios (10-20% better than ZIP) through advanced algorithms. Popular on Windows with WinRAR software. Supports recovery records for damaged archive repair, solid compression for better ratios, strong AES encryption, and split archives up to 8 exabytes. Excellent for long-term storage, large file collections, and backup scenarios. Common in software distribution and file sharing communities. Requires WinRAR or compatible software (not built into most systems).

7Z

7-Zip Archive - open-source format by Igor Pavlov (1999) providing the best compression ratio available (20-40% better than ZIP, 10-15% better than RAR). Uses LZMA and LZMA2 algorithms with strong AES-256 encryption. Supports huge file sizes (16 exabytes), multiple compression methods, solid compression, and self-extracting archives. Free from licensing restrictions and patent concerns. Perfect for maximizing storage efficiency, software distribution, and backup archives where size matters. Requires 7-Zip or compatible software but offers exceptional space savings.

Unix Formats

TAR

TAR Archive - Tape Archive format from Unix (1979) bundling multiple files and directories into single file without compression. Preserves file permissions, ownership, timestamps, and symbolic links critical for Unix systems. Often combined with compression (TAR.GZ, TAR.BZ2, TAR.XZ) for efficient distribution. Standard format for Linux software packages, system backups, and cross-platform file transfer. Essential for maintaining Unix file attributes. Works with streaming operations enabling network transfers and piping. Foundation of Unix/Linux backup and distribution systems.

GZ/TGZ

GZIP/TGZ - GNU zip compression format (1992) using DEFLATE algorithm, standard compression for Linux and Unix systems. TGZ is TAR archive compressed with GZIP. Fast compression and decompression with moderate ratios (50-70% reduction for text). Single-file compression commonly paired with TAR for multi-file archives. Universal on Unix/Linux systems with built-in 'gzip' command. Perfect for log files, text data, Linux software distribution, and web server compression. Streaming-friendly enabling on-the-fly compression. Industry standard for Unix file compression since the 1990s.

BZ2/TBZ2

BZIP2/TBZ2 - block-sorting compression format by Julian Seward (1996) offering better compression than GZIP (10-15% smaller) at the cost of slower processing. TBZ2 is TAR archive compressed with BZIP2. Uses Burrows-Wheeler transform achieving excellent ratios on text and source code. Popular for software distribution where size matters more than speed. Common in Linux package repositories and source code archives. Ideal for archival storage, software releases, and situations prioritizing compression over speed. Standard tool on most Unix/Linux systems.

XZ/TXZ

XZ/TXZ - modern compression format (2009) using LZMA2 algorithm providing excellent compression ratios approaching 7Z quality. TXZ is TAR archive compressed with XZ. Superior to GZIP and BZIP2 with ratios similar to 7Z but as single-file stream. Becoming the new standard for Linux distributions and software packages. Supports multi-threading for faster processing. Perfect for large archives, software distribution, and modern Linux systems. Smaller download sizes for software packages while maintaining fast decompression. Default compression for many current Linux distributions.

TAR.7Z

{format_tar_7z_desc}

TAR.BZ

{format_tar_bz_desc}

TAR.LZ

{format_tar_lz_desc}

TAR.LZMA

{format_tar_lzma_desc}

TAR.LZO

{format_tar_lzo_desc}

TAR.Z

{format_tar_z_desc}

TGZ

TGZ - TAR archive compressed with GZIP compression. Combines TAR's file bundling with GZIP's compression in single extension (.tgz instead of .tar.gz). Standard format for Linux software distribution and source code packages. Maintains Unix file permissions and attributes while reducing size 50-70%. Fast compression and decompression speeds. Universal compatibility on Unix/Linux systems. Perfect for software releases, backup archives, and cross-platform file transfer. Abbreviated form of TAR.GZ with identical functionality and structure.

TBZ2

TBZ2 - TAR archive compressed with BZIP2 compression. Better compression than TGZ (10-15% smaller) but slower processing. Uses Burrows-Wheeler block sorting for excellent text compression. Common in Linux distributions and software packages where size is critical. Maintains Unix file permissions and attributes. Perfect for source code distribution, archival storage, and bandwidth-limited transfers. Abbreviated form of TAR.BZ2 with identical functionality. Standard format for Gentoo Linux packages and large software archives.

TXZ

TXZ - TAR archive compressed with XZ (LZMA2) compression. Modern format offering best compression ratios for TAR archives (better than TGZ and TBZ2). Fast decompression despite high compression. Supports multi-threading for improved performance. Becoming standard for Linux distributions (Arch, Slackware use TXZ). Maintains Unix permissions and symbolic links. Perfect for large software packages, system backups, and efficient storage. Abbreviated form of TAR.XZ representing the future of Unix archive compression.

LZMA

LZMA/TAR.LZMA - Lempel-Ziv-Markov chain Algorithm compression format (2001) offering excellent compression ratios. TAR.LZMA combines TAR archiving with LZMA compression. Predecessor to XZ format using similar algorithm but older container format. Better compression than GZIP and BZIP2 but superseded by XZ/LZMA2. Still encountered in older Linux distributions and legacy archives. Slower compression than GZIP but better ratios (similar to XZ). Modern systems prefer TAR.XZ over TAR.LZMA. Legacy format for accessing older compressed archives from 2000s era.

LZO

LZO/TAR.LZO - Lempel-Ziv-Oberhumer compression format prioritizing speed over compression ratio. TAR.LZO is TAR archive compressed with LZO. Extremely fast compression and decompression (faster than GZIP) with moderate ratios (30-50% reduction). Popular in real-time applications, live systems, and scenarios requiring instant decompression. Used by some Linux kernels and embedded systems. Common in backup solutions prioritizing speed. Perfect for temporary compression, live CD/USB systems, and high-speed data transfer. Trade-off: larger files than GZIP/BZIP2/XZ but much faster processing.

Z

Z/TAR.Z - Unix compress format from 1985 using LZW (Lempel-Ziv-Welch) algorithm. TAR.Z is TAR archive compressed with compress command. Historical Unix compression format predating GZIP. Patent issues (until 2003) led to GZIP replacing it. Legacy format with poor compression by modern standards. Rarely used today except in very old Unix systems and historical archives. If you encounter .Z or .tar.Z files, convert to modern formats (TAR.GZ, TAR.XZ) for better compression and wider support. Important for accessing ancient Unix archives from 1980s-1990s.

专业格式

ISO

ISO Image - ISO 9660 disk image format containing exact sector-by-sector copy of optical media (CD/DVD/Blu-ray). Standard format for distributing operating systems, software installations, and bootable media. Can be mounted as virtual drive without physical disc. Contains complete filesystem including boot sectors, metadata, and file structures. Essential for Linux distributions, system recovery media, and software archives. Used by burning software, virtual machines, and media servers. Universal standard with support in all major operating systems for mounting and burning.

CAB

Cabinet Archive - Microsoft's compression format for Windows installers and system files. Used extensively in Windows setup packages, driver installations, and system updates. Supports multiple compression algorithms (DEFLATE, LZX, Quantum), split archives, and digital signatures. Built into Windows with native extraction support. Common in software distribution for Windows applications, particularly older installers and Microsoft products. Maintains Windows-specific attributes and can store multiple files with folder structures. Part of Windows since 1996.

AR

AR Archive - Unix archiver format (1970s) originally for creating library archives (.a files). Simple format storing multiple files with basic metadata (filename, modification time, permissions). Used primarily for static libraries in Unix development (.a extension). Foundation format for DEB packages (Debian packages are AR archives containing control and data). Minimal compression support (none by default). Essential for Unix library management and Debian package structure. Standard tool 'ar' included on all Unix/Linux systems. Simple and reliable for static file collections.

DEB

Debian Package - software package format for Debian, Ubuntu, and derivative Linux distributions. Contains compiled software, installation scripts, configuration files, and dependency metadata. Used by APT package manager (apt, apt-get commands). Actually a special AR archive containing control files and data archives. Essential format for Debian-based Linux software distribution. Includes pre/post-installation scripts, version management, and dependency resolution. Standard packaging for thousands of Ubuntu/Debian applications. Can be inspected and extracted as regular archive.

RPM

RPM Package - Red Hat Package Manager format for Red Hat, Fedora, CentOS, SUSE, and derivative Linux distributions. Contains compiled software, installation metadata, scripts, and dependency information. Used by YUM and DNF package managers. Includes GPG signature support for security verification. Standard for Red Hat Enterprise Linux ecosystem. Supports pre/post-installation scriptlets, file verification, and rollback capabilities. Essential format for RHEL-based Linux software distribution. Can be extracted as archive to inspect contents without installation.

JAR

JAR档案 - 基于ZIP压缩的Java档案格式,用于打包Java应用程序。包含编译后的Java类(.class文件)、应用程序资源和清单元数据。Java应用程序和库的标准分发格式。支持数字签名以进行代码验证。可以是可执行的(带有Main-Class清单的可运行JAR文件)。非常适合Java应用程序部署、库分发和插件系统。与ZIP工具兼容,但包含Java特定功能。自1996年以来,Java开发和部署的基本格式。

ARJ

ARJ Archive - legacy DOS compression format by Robert Jung (1991). Popular in DOS and early Windows era for its good compression ratio and ability to create multi-volume archives. Supports encryption, damage protection, and archive comments. Largely obsolete today, replaced by ZIP, RAR, and 7Z. Still encountered in legacy systems and old software archives. Requires ARJ or compatible decompression software. Historical format important for accessing old DOS/Windows archives from 1990s. Better converted to modern formats for long-term accessibility.

LHA

LHA档案 - 1988年开发的日本压缩格式(也称为LZH),在日本和Amiga用户中极为流行。使用LZSS和LZHUF压缩算法,提供良好的压缩比。1990年代日本软件分发中常见。支持档案头、目录结构和文件属性。遗留格式,现在大多被现代替代品取代。在复古计算、日本软件档案和Amiga社区中仍然可以遇到。提取需要LHA/LZH兼容软件。对于访问日本和Amiga软件档案非常重要。

CPIO

CPIO Archive - Copy In/Out archive format from Unix (1970s) for creating file archives. Simpler than TAR, often used for system backups and initramfs/initrd creation. Standard format for Linux initial RAM disk images. Supports multiple formats (binary, ASCII, CRC). Better handling of special files and device nodes than TAR. Common in system administration, bootloader configurations, and kernel initrd images. Universal on Unix/Linux systems. Essential for system-level archiving and embedded Linux systems. Works well for streaming operations.

如何转换文件

上传您的文件,选择输出格式,立即下载转换后的文件。我们的转换器支持批量转换并保持高质量。

常见问题

什么是 JAR 文件,为什么在 Java 应用程序中使用它?

JAR 文件(Java ARchive)是一种打包格式,将 Java 类、资源、图像、库和元数据捆绑到一个基于 ZIP 的容器中。它允许开发人员将整个 Java 程序或组件作为一个可移植文件进行打包,而不是分发数十或数百个单独的 .class 文件和资源文件夹。

由于 JAR 遵循 ZIP 标准,它有效地压缩内容,同时保留对 Java 类加载系统至关重要的目录结构和元数据。这使得 JAR 非常适合于部署、模块化和共享可重用的代码库。

Many Java applications, web servers, Android build tools, game engines, and enterprise systems depend on JAR packaging for predictable loading, easy distribution, and consistent runtime behavior across platforms.

为什么有些 JAR 文件可以直接运行而其他的不能?

只有可执行的 JAR 包含一个清单条目,指定哪个类包含应用程序的 main() 方法。这个条目 Main-Class 指示 Java 运行时要执行哪个文件。

库 JAR 并不打算被启动。它们包含的类和资源旨在被其他应用程序导入,而不是独立运行。

工具也很重要:某些 JAR 需要额外的类路径依赖。如果缺少这些依赖,即使 JAR 有入口点,也无法独立运行。

为什么 JAR 文件有时比预期的要大?

JAR 通常包含多个库、配置文件、图标、翻译和其他资源,捆绑在一起以简化使用。

某些 JAR 包含多个平台的编译字节码或嵌入第三方框架,导致文件大小增加。

最小化和阴影处理是可选步骤;许多开发人员选择便利而非优化,导致文件更大。

为什么 JAR 文件即使类存在仍会抛出 'ClassNotFoundException'?

JAR 依赖于精确的包路径。如果内部目录结构与包声明不匹配,Java 将无法找到该类。

类路径配置错误——尤其是在混合多个 JAR 时——通常会导致运行时无法找到所需的依赖。

阴影或重新打包的库可能也会改变类的位置,打破引用,除非重新定位配置正确。

为什么提取 JAR 文件时不会显示与源项目相同的文件夹结构?

源代码目录被转换为编译的字节码输出,移除了仅在编译期间存在的开发路径。

构建工具如 Maven 和 Gradle 通常会重新组织资源,将它们从多个模块合并到最终工件中。

JAR 故意省略源文件夹以减小大小,除非创建单独的 *-sources.jar。

JAR 文件的安全性如何?

未签名的 JAR 可以在不被检测的情况下被修改,使其在不受信任的环境中易受攻击。

签名的 JAR 使用加密证书来验证真实性,确保归档未被更改。

然而,即使是签名的 JAR 也可能包含不安全的代码;签名仅确保身份,而不保证安全。仍然需要沙箱和 JVM 安全策略。

为什么 JAR 文件有时需要特定的 Java 版本?

Java 字节码在不断演变。如果 JAR 是使用较新 Java 版本的特性编译的,较旧的 JVM 将无法识别该类文件格式。

后续 Java 版本中引入的模块和新 API 在较旧的运行时中可能也缺失。

构建工具通常设置目标 Java 版本;不匹配的环境设置会导致不兼容的 JAR。

为什么 JAR 会因 'Invalid or corrupt jarfile' 而失败?

下载中断或传输损坏可能会破坏 JAR 内部的 ZIP 结构。

文件开头的非 ZIP 数据——例如来自合并或包装——会导致 JVM 拒绝它。

不当打包,例如在没有正确结构的情况下将 JAR 压缩到另一个 JAR 中,也可能使其无法读取。

为什么开发人员直接将依赖项打包到 JAR 中?

Fat JAR 或 Uber JAR 通过将每个依赖项打包到一个文件中简化了部署,消除了类路径配置问题。

阴影处理通过在独特的命名空间下重新定位依赖包来避免版本冲突。

这种方法对于 CLI 应用程序、无服务器部署和独立实用程序特别有用。

为什么模块化 JAR 与普通的不同?

Java 9 引入了 JPMS 模块,允许 JAR 定义明确的导出、依赖和访问规则。

模块描述符暴露了更清晰的依赖图,减少了类路径的模糊性。

模块化 JAR 提高了性能和安全性,但需要仔细配置以避免模块解析失败。

为什么我的 JAR 在 IDE 中工作,但手动执行时却不行?

IDE 会自动设置类路径、资源路径和依赖解析,后台处理这些。

手动运行时,缺少依赖、目录不正确或缺少清单会导致失败。

环境差异——Java 版本、工作目录、操作系统路径格式——也会影响运行时行为。

为什么更新 JAR 不会立即更新应用程序?

缓存的类加载器——尤其是在服务器中——可能会在完全重启之前将旧版本保留在内存中。

某些系统需要清除插件文件夹或依赖缓存才能加载更新的工件。

如果在编译之前未清理缓存,打包工具可能会重用旧的构建输出。

为什么 JAR 的性能在不同环境中会有所不同?

不同的 JVM 实现以不同的方式优化字节码执行,从而影响运行时速度。

硬件差异——CPU 架构、垃圾回收器行为、可用内存——会影响执行效率。

后台服务、磁盘速度和操作系统调度也会影响性能。

尽管有 JMOD 或 WAR 等更新替代品,为什么 JAR 仍然被广泛使用?

JAR 在所有 JVM 中都得到普遍支持,执行或提取时无需特殊工具。

它极其灵活:适用于应用程序、库、插件和构建工件,无需格式更改。

大多数 Java 生态系统、构建工具和框架都是围绕 JAR 构建的,确保了长期的相关性。

您应该选择 JAR 作为主要打包格式吗?

如果您需要一个可移植的跨平台 Java 库或应用程序容器,请选择 JAR。

它非常适合可重用库、CLI 工具、微服务、插件系统和模块化组件。

对于依赖项较多或部署复杂的应用程序,请考虑 fat JAR、WAR/EAR 包或容器化解决方案。