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 8105941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:18:24+00:00 2026-06-06T00:18:24+00:00

(ns lol.test (:gen-class :name lol.test :methods [[createHashMap [String] Java.util.HashMap]]) (:import [java.util HashMap])) (defn -createHashMap

  • 0
(ns lol.test
  (:gen-class
   :name lol.test
   :methods [[createHashMap [String] Java.util.HashMap]])
  (:import [java.util HashMap]))

(defn -createHashMap [this s]
  (HashMap. (assoc {} s "test")))

I’m trying to call clojure functions from java, for this purpose I’ve created this file which prefectly compiles with lein, I create a jar file by calling “lein uberjar”.

Now the problem is that when I call it from java like this:

lol.test l = new lol.test();
l.createhashMap("test");

it throws an ArityException

Wrong number of args (2) passed to

I’ve tried to remove ‘this’ argument from clojure code but it didn’t help. What’s the problem with this code?

  • 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-06-06T00:18:26+00:00Added an answer on June 6, 2026 at 12:18 am

    You need to fix the :methods declaration. Right now you have

    :methods [[createHashMap [String] java.util.HashMap]]
    

    It has to become

    :methods [[createHashMap [Test String] java.util.HashMap]]
    

    otherwise you’re only getting a 1-arity method in your compiled class.

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

Sidebar

Related Questions

let's say I have this string array in java String[] test = {"hahaha lol",
I have a string that is something like this: $str= <code> lol test </code>
this is my textarea prepared for ckeditor to launch on: <textarea name=Message id=RFMessage lol
class Test def printsomething p lol end end teet = Test.new p #{teet.printsomething} Output
Here is my code: $string = <<<XML <?xml version='1.0'?> <test> <testing> <lol>hello</lol> <lol>there</lol> </testing>
Forgive me for the upcoming question, lol. (Im terribly new at this) I have
I'm going nuts on this. (as most people posting here lol) I have a
This is killing me! LOL I tried everything, hover, mouseover, mouseenter...stop(true) Why is this
I'm having a problem trying to test of the device I know this subject
HTML new_password: <input name=new_password type=password maxlength=25 id=new_password class=ModuleTextbox onkeyup=var regex = new RegExp(/^.*(?=.{6,})(?=.*\d)(?=.*[aA-zZ@!¤&amp;/()_?,.-]).*$/m); if(regex.test(this.value))

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.