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

  • Home
  • SEARCH
  • 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 1089353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:12:32+00:00 2026-05-16T23:12:32+00:00

Does anybody want to answer my question linked here how-to-pass-a-typed-collection-from-clojure-to-java , by providing a

  • 0

Does anybody want to answer my question linked here how-to-pass-a-typed-collection-from-clojure-to-java
, by providing a clear example, for the rest of us who are trying to sneak clojure in their existing java stack?

  • 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-16T23:12:33+00:00Added an answer on May 16, 2026 at 11:12 pm

    From Chas Emerick’s answer to my original question, I have setup this small maven project:

    interop ---- domainobjects ---- IFoo.java
                               ---- TypedObject.java
                               ---- pom.xml
    
            ---- functional    ---- fooimpl.clj
                               ---- pom.xml
    
            ---- consumer      ---- JavaConsumer.java
                               ---- JavaConsumerTest.groovy
                               ---- pom.xml
            ---- pom.xml
    
    ######################################################################################
    
    package com.tobeconsumed.byjava;
    
    import java.util.List;
    
    public interface IFoo {
        List<TypedObject> createListOfTypedObjects(String message);
    }
    
    
    package com.tobeconsumed.byjava;
    
    public class TypedObject {
    
        private String property;
    
        public String getProperty() {
            return property;
        }
    
        public void setProperty(String property) {
            this.property = property;
        }
    }
    
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <parent>
        <artifactId>interop</artifactId>
        <groupId>interop</groupId>
        <version>0.0.1-SNAPSHOT</version>
      </parent>
      <groupId>interop</groupId>
      <artifactId>domainobjects</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <name>domainobjects</name>
      <description>Contains all of the domain objects.</description>
    
      <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
          <version>1.7.4</version>
        </dependency>    
      </dependencies>
    
      <build>
    
        <finalName>domainobjects</finalName>
    
        <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
              <source>1.6</source>
              <target>1.6</target>
              <project>
                <build>
                    <scriptSourceDirectory>src/main/java</scriptSourceDirectory>
                    <testSourceDirectory>src/test/java</testSourceDirectory>
                </build>
              </project>
            </configuration>
            <executions>
             <execution>
               <id>compile</id>
               <phase>compile</phase>
               <goals>
                 <goal>compile</goal>
               </goals>
             </execution>
             <execution>
               <id>test-java</id>
               <phase>test</phase>
               <goals>
                 <goal>testCompile</goal>
               </goals>
             </execution>
           </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.2</version>
            <extensions>true</extensions>
            <configuration>
                <project>
                <build>
                    <sourceDirectory>src/main/groovy</sourceDirectory>
                    <testSourceDirectory>src/test/groovy</testSourceDirectory>
                </build>
                </project>
            </configuration>
          </plugin>
          <plugin>
        <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <configuration>
                            <tasks>
                                <mkdir dir="${basedir}/src/main/groovy"/>
                                <taskdef name="groovyc"
                                    classname="org.codehaus.groovy.ant.Groovyc">
                                    <classpath refid="maven.compile.classpath"/>
                                </taskdef>
                                <mkdir dir="${project.build.outputDirectory}"/>
                                <groovyc destdir="${project.build.outputDirectory}"
                                    srcdir="${basedir}/src/main/groovy/" listfiles="true">
                                    <classpath refid="maven.compile.classpath"/>
                                </groovyc>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <configuration>
                            <tasks>
                                <mkdir dir="${basedir}/src/test/groovy"/>
                                <taskdef name="groovyc"
                                    classname="org.codehaus.groovy.ant.Groovyc">
                                    <classpath refid="maven.compile.classpath"/>
                                </taskdef>
                                <mkdir dir="${project.build.testOutputDirectory}"/>
                                <groovyc destdir="${project.build.testOutputDirectory}"
                                    srcdir="${basedir}/src/test/groovy/" listfiles="true">
                                    <classpath refid="maven.test.classpath"/>
                                </groovyc>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
           </plugin>      
        </plugins>
      </build>
    
    </project>
    
    
    ######################################################################################
    
    (ns com.tobeconsumed.byjava.fooimpl
      (:import com.tobeconsumed.byjava.IFoo)
      (:gen-class
        :implements [com.tobeconsumed.byjava.IFoo]))
    
    (defn -createListOfTypedObjects
      "Creates and returns a list of TypedObjects"
      [this message]
      (println message)
      [(TypedObject.), (TypedObject.), (TypedObject.), (TypedObject.)])
    
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <parent>
        <artifactId>interop</artifactId>
        <groupId>interop</groupId>
        <version>0.0.1-SNAPSHOT</version>
      </parent>
      <groupId>interop</groupId>
      <artifactId>functional</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <name>functional</name>
      <description>Some functional code.</description>
    
      <repositories>
        <repository>
          <id>clojars</id>
          <url>http://clojars.org/repo/</url>
        </repository>
        <repository>
          <id>clojure-releases</id>
          <url>http://build.clojure.org/releases</url>
        </repository>
        <repository>
          <id>clojure-snapshots</id>
          <url>http://build.clojure.org/snapshots</url>
        </repository>
        <repository>
          <id>central</id>
          <url>http://repo1.maven.org/maven2</url>
        </repository>
      </repositories>
    
      <dependencies>
        <dependency>
          <groupId>interop</groupId>
          <artifactId>domainobjects</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.clojure</groupId>
          <artifactId>clojure</artifactId>
          <version>1.2.0</version>
          <type>pom</type>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>org.clojure</groupId>
          <artifactId>clojure-contrib</artifactId>
          <version>1.2.0</version>
          <type>pom</type>
          <scope>compile</scope>
        </dependency>
      </dependencies>
    
      <build>
        <plugins>
            <plugin>
            <groupId>com.theoryinpractise</groupId>
            <artifactId>clojure-maven-plugin</artifactId>
            <version>1.3.3</version>
            <configuration>
                <project>
                    <build>
                        <sourceDirectory>src/main/clojure</sourceDirectory>
                        <testSourceDirectory>src/test/clojure</testSourceDirectory>
                    </build>
                </project>
            </configuration>
            <executions>
             <execution>
               <id>compile</id>
               <phase>compile</phase>
               <goals>
                 <goal>compile</goal>
               </goals>
             </execution>
             <execution>
               <id>test-clojure</id>
               <phase>test</phase>
               <goals>
                 <goal>test</goal>
               </goals>
             </execution>
           </executions>
          </plugin>
        </plugins>
      </build>
    
    </project>
    
    
    ######################################################################################
    
    
    
    package consumer;
    
    import java.util.List;
    
    import com.tobeconsumed.byjava.IFoo;
    import com.tobeconsumed.byjava.TypedObject;
    import com.tobeconsumed.byjava.fooimpl;
    
    public class JavaConsumer {
    
        public List<TypedObject> callCreateListOfTypedObjects() {
            IFoo foo = new fooimpl();
            List<TypedObject> listOfTypedObject = foo.createListOfTypedObjects("Returning typed a list");
            return listOfTypedObject;
        }
    
    }
    
    
    package consumer;
    
    import junit.framework.TestCase;
    
    public class JavaConsumerTest extends TestCase {
    
        private JavaConsumer javaConsumer;
    
        protected void setUp() throws Exception {
            javaConsumer = new JavaConsumer();
            super.setUp();
        }
    
        protected void tearDown() throws Exception {
            javaConsumer = null;
            super.tearDown();
        }
    
        public void testCallShowMessage() {
            assertNotNull(javaConsumer);
            def result = javaConsumer.callCreateListOfTypedObjects();
    
            assert 4 == result.size()
        }
    
    }
    
    
    <?xml version="1.0"?>
    <project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <modelVersion>4.0.0</modelVersion>
      <parent>
        <artifactId>interop</artifactId>
        <groupId>interop</groupId>
        <version>0.0.1-SNAPSHOT</version>
      </parent>
      <groupId>interop</groupId>
      <artifactId>consumer</artifactId>
      <version>0.0.1-SNAPSHOT</version>
      <packaging>war</packaging>
      <name>consumer</name>
      <url>http://maven.apache.org</url>
      <dependencies>
        <dependency>
          <groupId>interop</groupId>
          <artifactId>functional</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
          <groupId>interop</groupId>
          <artifactId>domainobjects</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <scope>compile</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
          <groupId>org.codehaus.groovy</groupId>
          <artifactId>groovy-all</artifactId>
          <version>1.7.4</version>
        </dependency>    
      </dependencies>
      <build>
    
        <finalName>consumer</finalName>
    
        <plugins>
            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
              <source>1.6</source>
              <target>1.6</target>
              <project>
                <build>
                    <scriptSourceDirectory>src/main/java</scriptSourceDirectory>
                    <testSourceDirectory>src/test/java</testSourceDirectory>
                </build>
              </project>
            </configuration>
            <executions>
             <execution>
               <id>compile</id>
               <phase>compile</phase>
               <goals>
                 <goal>compile</goal>
               </goals>
             </execution>
             <execution>
               <id>test-java</id>
               <phase>test</phase>
               <goals>
                 <goal>testCompile</goal>
               </goals>
             </execution>
           </executions>
          </plugin>
          <plugin>
            <groupId>org.codehaus.gmaven</groupId>
            <artifactId>gmaven-plugin</artifactId>
            <version>1.2</version>
            <extensions>true</extensions>
            <configuration>
                <project>
                <build>
                    <sourceDirectory>src/main/groovy</sourceDirectory>
                    <testSourceDirectory>src/test/groovy</testSourceDirectory>
                </build>
                </project>
            </configuration>
          </plugin>
          <plugin>
        <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-antrun-plugin</artifactId>
                <executions>
                    <execution>
                        <id>compile</id>
                        <phase>compile</phase>
                        <configuration>
                            <tasks>
                                <mkdir dir="${basedir}/src/main/groovy"/>
                                <taskdef name="groovyc"
                                    classname="org.codehaus.groovy.ant.Groovyc">
                                    <classpath refid="maven.compile.classpath"/>
                                </taskdef>
                                <mkdir dir="${project.build.outputDirectory}"/>
                                <groovyc destdir="${project.build.outputDirectory}"
                                    srcdir="${basedir}/src/main/groovy/" listfiles="true">
                                    <classpath refid="maven.compile.classpath"/>
                                </groovyc>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <phase>test-compile</phase>
                        <configuration>
                            <tasks>
                                <mkdir dir="${basedir}/src/test/groovy"/>
                                <taskdef name="groovyc"
                                    classname="org.codehaus.groovy.ant.Groovyc">
                                    <classpath refid="maven.compile.classpath"/>
                                </taskdef>
                                <mkdir dir="${project.build.testOutputDirectory}"/>
                                <groovyc destdir="${project.build.testOutputDirectory}"
                                    srcdir="${basedir}/src/test/groovy/" listfiles="true">
                                    <classpath refid="maven.test.classpath"/>
                                </groovyc>
                            </tasks>
                        </configuration>
                        <goals>
                            <goal>run</goal>
                        </goals>
                    </execution>
                </executions>
           </plugin>      
        </plugins>
      </build>
    </project>
    
    ######################################################################################
    
    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
      <modelVersion>4.0.0</modelVersion>
      <groupId>interop</groupId>
      <artifactId>interop</artifactId>
      <packaging>pom</packaging>
      <version>0.0.1-SNAPSHOT</version>
      <name>interop</name>
    
      <repositories>
        <repository>
          <id>central</id>
          <url>http://repo1.maven.org/maven2</url>
        </repository>
      </repositories>
    
      <dependencies>
      </dependencies>
    
      <build>
        <plugins>
        </plugins>
      </build>
      <modules>
        <module>functional</module>
        <module>consumer</module>
        <module>domainobjects</module>
      </modules>
    
    </project>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anybody know how to get thumbnail (still image) from 3gb video file? First
I have a question very similar to this one but the answer does not
My question is relativly simple. Does anybody know a free library (LGPL) that is
Does anybody know any good resources for learning how to program CIL with in-depth
Does anybody recommend a design pattern for taking a binary data file, parsing parts
Does anybody use the Class Designer much in Visual Studio? I have downloaded the
Does anybody know a technique to discover memory leaks caused by smart pointers? I
Does anybody know of any sample databases I could download, preferably in CSV or
Does anybody know of a way to list up the loaded plugins in Vim
Does anybody know the logic behind making DataSourceSelectArguments sealed? I've implemented a custom DataSource

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.