This is a Swift package with support for macOS that allows to start Java Jar's with the default or a custom JVM.

Related tags

Utility Jar.swift
Overview

Jar.swift

jar runner for macos

Jar.swift is created and maintaned with ❥ by Sascha Muellner.


Swift codecov License Version SPM compatible README

What?

This is a Swift package with support for macOS that allows to start Java Jar's with the default or a custom JVM.

Requirements

The latest version of Jar requires:

  • Swift 5+
  • macOS 10.12+
  • Xcode 11+

Installation

Swift Package Manager

Using SPM add the following to your dependencies

'Jar', 'main', 'https://github.com/SwiftPackageRepository/Jar.swift.git'

How to use?

Run a remote Jar

For running a remote Jar the only requirement is creating a Jar reference with the origin of the Jar and the locale name for the cache. After creating a Java runtime reference the Jar can be just "executed".

    let jar = Jar(origin: URL(string: "https://domain.com/your.jar"), filename: "your.jar")
    let java = Java()
    let (result, error) = java.run(jar: jar, args: [])

or more complete for running the HelloWorld.jar:

import Foundation
import Jar

struct HelloWorld {
    static func run() {
        let url = URL(string: "https://github.com/slaminatl/Helloworld/raw/master/out/artifacts/HelloWorld_jar/HelloWorld.jar")!
        let jar = Jar(origin: url, filename: "helloworld.jar")
        let java = Java()
        let (result, error) = java.run(jar: jar, args: [])
        if let result = result {
            print(result)
        } else if let error = error {
            print(error.localizedDescription)
        }
    }
}
You might also like...
Swift Sequences are limited in that they don't support Iterators with a throwing next().

FailableSequence Swift Sequences are limited in that they don't support Iterators with a throwing next(). There are several use cases for such sequenc

Support library of BudouX.swift to handle HTML

HTMLBudouX.swift HTMLBudouX.swift is a support library of BudouX.swift to handle HTML. Detail about BudouX.swift is here Usage You can translate an HT

Collection of native Swift extensions to boost your development. Support tvOS and watchOS.
Collection of native Swift extensions to boost your development. Support tvOS and watchOS.

SparrowKit Collection of native Swift extensions to boost your development. Support iOS, tvOS and watchOS. If you like the project, don't forget to pu

A command-line tool and Swift Package for generating class diagrams powered by PlantUML
A command-line tool and Swift Package for generating class diagrams powered by PlantUML

SwiftPlantUML Generate UML class diagrams from swift code with this Command Line Interface (CLI) and Swift Package. Use one or more Swift files as inp

A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.
A Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and other native frameworks.

ZamzamKit ZamzamKit is a Swift package for rapid development using a collection of micro utility extensions for Standard Library, Foundation, and othe

Swift implementation of the package url spec

PackageURL Swift implementation of the package url specification. Requirements Swift 5.3+ Usage import PackageURL let purl: PackageURL = "pkg:swift/a

Swift Package for Decoding RSS Feeds.

SyndiKit Swift Package built on top of XMLCoder for Decoding RSS Feeds. Check out the DocC-Built Site! Table of Contents Introduction Features Install

A simple Swift package for counting the Syllables in a sentence.

A simple Swift package for counting the Syllables in a sentence.

Azure Maps iOS SDK binary distribution for Swift Package Manager
Azure Maps iOS SDK binary distribution for Swift Package Manager

Azure Maps Control for iOS Installation In your Xcode iOS Project settings, under Project setting’s Package Dependencies, click on + button to add pac

Owner
Swift Package Repository
Place for common swift libraries.
Swift Package Repository
Mechanical editing support for Package.swift manifests

Mechanical editing support for Package.swift manifests. Implements Swift Evolution proposal SE-301

Owen Voorhees 9 Jan 4, 2023
Protected is a Swift Package that allows you to specify the read and write rights for any type, depending on context by using Phantom types

Protected is a Swift Package that allows you to specify the read and write rights for any type, depending on context by using Phantom types

Mathias Quintero 9 Sep 25, 2022
macOS utility for converting fat-frameworks to SPM-compatible XCFramework with arm64-simulator support

xcframework-maker macOS utility for converting fat-frameworks to SPM-compatible XCFramework with arm64-simulator support. ?? Description make-xcframew

Dariusz Rybicki 312 Dec 22, 2022
A drop-in `NSComboButton` replacement with pre macOS 13 support.

DSFComboButton A drop-in NSComboButton replacement control with pre macOS 13 support. For when you want to adopt NSComboButton but have to maintain co

Darren Ford 8 Nov 9, 2022
ALO sync allows you to sync resources form an ALO endpoint to your macOS file system.

ALO sync allows you to sync resources form an ALO endpoint to your macOS file system. Prerequisites macOS 11 No support for search* No suppor

Lawrence Bensaid 2 Jan 22, 2022
BCSwiftTor - Opinionated pure Swift controller for Tor, including full support for Swift 5.5 and Swift Concurrency

BCSwiftTor Opinionated pure Swift controller for Tor, including full support for

Blockchain Commons, LLC — A “not-for-profit” benefit corporation 4 Oct 6, 2022
Swift-when - Expression switch support in Swift

Swift When - supporting switch expressions in Swift! What is it? Basically, it a

Gordan Glavaš 7 Nov 24, 2022
Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Swift Markdown is a Swift package for parsing, building, editing, and analyzing Markdown documents.

Apple 2k Dec 28, 2022
Approximate is a Swift package that provides implementations of floating point comparisons for the Swift ecosystem

Approximate Approximate floating point equality comparisons for the Swift Programming Language. Introduction Approximate is a Swift package that provi

Christopher Blanchard 1 Jun 1, 2022
A simple swift package that provides a Swift Concurrency equivalent to `@Published`.

AsyncValue This is a simple package that provides a convenience property wrapper around AsyncStream that behaves almost identically to @Published. Ins

Brent Mifsud 33 Oct 3, 2022