Skip to content

Instantly share code, notes, and snippets.

@chandu-io
Last active August 29, 2015 13:56
Show Gist options
  • Select an option

  • Save chandu-io/8926236 to your computer and use it in GitHub Desktop.

Select an option

Save chandu-io/8926236 to your computer and use it in GitHub Desktop.
java :: ejar.bat :: batch script to generate java executable jars

Batch script to generate java executable jars

Requirements

  1. compiled java class files
  2. manifest file ending in .txt with intended jar name (i.e., jarname.txt)

How to use

  1. In command prompt, type the following

    c:\> ejar <jarname> <version_string>

@echo off
set classname=%1
set version=%2
if "%version%" == "" (
set jarname=%classname%.jar
) else (
set jarname=%classname%-%version%.jar
)
set manifest=%classname%.txt
jar -cvfm %jarname% %manifest% %classname%*.class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment