خرید بک لینک

Vote count: 0

I'm trying to make a stand alone jar from my bare-bones Clojure project using the Leiningen plugin in Intellij's Cursive.

To create the project, I just created the project.clj file, opened it, and Cursive offered to import it as a project.

project.clj:

(defproject WaterTimer "1"
  :description "A timer that reminds you to drink water"
  :main tone-producer/main)

tone-producer.clj:

(ns tone-producer
  (:require [general-helpers :as g])

  (:import [javax.sound.midi MidiSystem
                             Synthesizer
                             MidiChael])
  (:gen-class))

(defn main [& args]
  (println "Test!"))

When I run the "uberjar" task, I get the following output:

Waing: specified :main without including it in :aot. Implicit AOT of :main will be removed in Leiningen 3.0.0. If you only need AOT for your uberjar, consider adding :aot :all into your :uberjar profile instead. Waing: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method. Created C:UsersslomiIdeaProjectsWaterTimertargetWaterTimer-1.jar Created C:UsersslomiIdeaProjectsWaterTimertargetWaterTimer-1-standalone.jar

I also tried changing the main function to have the default name, and omit the name from the defproject:

(defproject WaterTimer "1"
  :description "A timer that reminds you to drink water"
  :main tone-producer)

(ns tone-producer
      (:require [general-helpers :as g])

      (:import [javax.sound.midi MidiSystem
                                 Synthesizer
                                 MidiChael])
      (:gen-class))

    (defn -main [& args]
      (println "Test!"))

But now I get the error:

Error: Could not find or load main class clojure.main Compilation failed: Subprocess failed

The structure is:

  • WaterTimer
    • src
      • tone-producer.clj
    • project.clj
    • target

Any guidance here would be appreciated.

asked 42 secs ago

- - , .
.

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 22 تير 1395 ساعت: 20:09

صفحه بندی