Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6678893
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:17:45+00:00 2026-05-26T04:17:45+00:00

To run Clojure files from command line, I’m using a zhs alias I added

  • 0

To run Clojure files from command line, I’m using a zhs alias I added to my .zshrc:

alias 'clojure=java -cp /home/sinan/cclojure/lib/clojure-1.2.1.jar:/home/sinan/cclojure/lib/clojure-contrib-1.2.0.jar clojure.main -i '

With this, I can run my Clojure app like this:

clojure test3.clj

But it doesn’t work when I want to send command line parameters.

➜  src  clojure test3.clj arg1 arg2
Exception in thread "main" java.io.FileNotFoundException: arg1 (No such file or directory)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:120)
        at java.io.FileInputStream.<init>(FileInputStream.java:79)
        at clojure.lang.Compiler.loadFile(Compiler.java:5817)
        at clojure.main$load_script.invoke(main.clj:221)
        at clojure.main$script_opt.invoke(main.clj:273)
        at clojure.main$main.doInvoke(main.clj:354)
        at clojure.lang.RestFn.invoke(RestFn.java:457)
        at clojure.lang.Var.invoke(Var.java:377)
        at clojure.lang.AFn.applyToHelper(AFn.java:172)
        at clojure.lang.Var.applyTo(Var.java:482)
        at clojure.main.main(main.java:37)

What am I doing wrong? Is my way of running Clojure apps wrong?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:17:45+00:00Added an answer on May 26, 2026 at 4:17 am

    you just need to specify name of script, without -i key after clojure.main. In your case, clojure.main thinks, that test.clj is program to eval before (and it do it), while arg1 is script to execute

    See description of option for clojure.main/main function

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Google Closure Compiler application (command line interface). When I run it I
Noob question, using Win7 64-bit, Clojure 1.2.0, Java 1.6.0_22 When I start clojure from
When I try to run the following code (from the REPL) in Clojure: (dotimes
I used Aquamacs so far, and I need to install and run Clojure using
I have a problem with the Enclojure REPL and using clojure modules from it.
I'm calling Clojure from Java and calling eval on a string passed in. The
I run my blog using Wordpress and all too recently became a big believer
We run full re-indexes every 7 days (i.e. creating the index from scratch) on
How would I eval to the following? (defn run-clojure-func [] (println welcome)) (defn -main
I download the clojure 1.2 and clojure-contrib-1.2.0.jar from the download site . And I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.