Re: hello world question !!!
thank, i have not read it in depth now but seems really interesting about both Java and Clojure Damien On Friday, October 20, 2017 at 7:23:37 PM UTC+2, Didier wrote: > > I also suggests if you want to understand how to compile Clojure without > thw help of tools loke boot or lein, to read those two short tutorials: > > 1. > http://www.flyingmachinestudios.com/programming/how-clojure-babies-are-made-the-java-cycle/ > > 2. > http://www.flyingmachinestudios.com/programming/how-clojure-babies-are-made-lein-run/ > > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: mysql and clojure
thank for your help, i had doubt about namespace but as i focused on sql i did not check it, it is just a week i use clojure, but i'm used many Scheme and LisP and Java and there is a lot of issue on stackoverflow or stackechange about clojure and mysql that are out of date and are confusing damien On Thursday, October 19, 2017 at 6:44:46 PM UTC+2, Sean Corfield wrote: > > I don’t know what documentation you’re working from but it looks outdated, > based on your code. > > > > Have a read of > http://clojure-doc.org/articles/ecosystem/java_jdbc/home.html -- that > will walk you through the basics of using java.jdbc > > > > If you’re on the Clojurians Slack (signup at http://clojurians.net/ and > read/post messages from https://clojurians.slack.com/ or use a desktop > client), there’s a #sql channel for all things JDBC-related. > > > > Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN > An Architect's View -- http://corfield.org/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > > ------ > *From:* clo...@googlegroups.com <clo...@googlegroups.com > > on behalf of Damien Mattei <damien...@gmail.com > > > *Sent:* Thursday, October 19, 2017 3:37:08 AM > *To:* Clojure > *Subject:* mysql and clojure > > hello again, > > i tried dozen of web example about mysql and clojure but it doen't work, > here is some of my code: > > for dependencies: > > (defproject jclojure "0.1.0-SNAPSHOT" > :description "clojure JVM source code for Sidonie web interface > administration" > :url "https://sidonie.oca.eu; > :license {:name "Eclipse Public License" > :url "http://www.eclipse.org/legal/epl-v10.html"} > > :dependencies [ > [org.clojure/clojure "1.8.0"] > [mysql/mysql-connector-java "5.1.38"] > [org.clojure/java.jdbc "0.7.3"] > ] > > :main ^:skip-aot jclojure.core > :target-path "target/%s" > :profiles {:uberjar {:aot :all}}) > > > the code (some of...): > > (ns jclojure.core > (:gen-class)) > > (defn -main > "I don't do a whole lot ... yet." > [& args] > > ;(:require [clojure.java [jdbc :as sql]]) > > ;(require '[clojure.java.jdbc :as jdbc]) > > (ns dbns > (:require [clojure.java.jdbc :as jdbc] > [mysql/mysql-connector-java "5.1.38"])) > > ;(use 'clojure.java.jdbc) > > (println "Hello, World!") > > (let [ > db-host "localhost" > db-port 3306 > db-name "sidonie" > ] > > (def db { > :classname "com.mysql.jdbc.Driver" ; must be in classpath > :subprotocol "mysql" > :subname (str "//" db-host ":" db-port "/" db-name) > ; Any additional keys are passed to the driver > ; as driver-specific properties. > :user "mattei" > :password "sidonie2"})) > > ;(jdbc/query db ["SELECT * FROM Sigles"]) > > (jdbc/with-connection db > (jdbc/with-query-results rows > ["select * from Sigles"] > (println rows))) > > > ) > > > and now the error: > > [mattei@moita jclojure]$ lein run > Exception in thread "main" java.lang.RuntimeException: No such namespace: > jdbc, compiling:(jclojure/core.clj:37:3) > at clojure.lang.Compiler.analyze(Compiler.java:6688) > at clojure.lang.Compiler.analyze(Compiler.java:6625) > at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766) > at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870) > at clojure.lang.Compiler.analyze(Compiler.java:6669) > at clojure.lang.Compiler.analyze(Compiler.java:6625) > at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001) > at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380) > at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972) > at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866) > at clojure.lang.Compiler.analyze(Compiler.java:6669) > at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856) > at clojure.lang.Compiler.analyze(Compiler.java:6669) > at clojure.lang.Compiler.access$300(Compiler.java:38) > at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589) > at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868) > at clojure.lang.Compiler.
Re: mysql and clojure
Thank Lubomir, it works, i'm new to Clojure and did not use the name space the right way, i had to remove [mysql/mysql-connector-java "5.1.38"] also , do not know why... here is the working code and result: (ns jclojure.core (:gen-class) (:require [clojure.java.jdbc :as jdbc] ) ) ;(ns jclojure.core ;(:gen-class) ;(:require [clojure.java.jdbc :as jdbc] ; [mysql/mysql-connector-java "5.1.38"])) (defn -main "I don't do a whole lot ... yet." [& args] ;(:require [clojure.java [jdbc :as sql]]) ;(require '[clojure.java.jdbc :as jdbc]) ;(ns dbns ; (:require [clojure.java.jdbc :as jdbc] ;[mysql/mysql-connector-java "5.1.38"])) ;(use 'clojure.java.jdbc) (println "Hello, World!") (let [ db-host "localhost" db-port 3306 db-name "sidonie" ] (def db { :classname "com.mysql.jdbc.Driver" ; must be in classpath :subprotocol "mysql" :subname (str "//" db-host ":" db-port "/" db-name) ; Any additional keys are passed to the driver ; as driver-specific properties. :user "mattei" :password "sidonie2"})) ;(jdbc/query db ["SELECT * FROM Sigles"]) (jdbc/query db ["select * from Sigles"] {:row-fn println} ) ;(jdbc/with-connection db ;(jdbc/with-query-results rows ; ["select * from Sigles"] ; (println rows))) ) [mattei@moita jclojure]$ lein run Hello, World! {:sigle ApJ, :intitulé AstroPhysical Journal} {:sigle ApJS, :intitulé AstroPhysical Journal - supplement} {:sigle A, :intitulé Astronomy and Astrophysics} {:sigle A, :intitulé Astronomy and Astrophysics - supplement series} {:sigle A.A.W., :intitulé Acta Astronomica Warszawa} {:sigle ABO, :intitulé Annals Bosscha Observatory} {:sigle ABS, :intitulé Annals Bosscha Sterrenwacht} {:sigle ADONU, :intitulé Annals Dearborn Observatory - Northwestern University} {:sigle AJ, :intitulé Astronomical Journal} {:sigle AJS, :intitulé Astronomical Journal - supplement} {:sigle AN, :intitulé Astronomische Nachrichten} {:sigle AORB, :intitulé Annales de l'Observatoire Royal de Belgique} {:sigle AOS, :intitulé Annales de l'Observatoire ... Damien On Thursday, October 19, 2017 at 12:49:31 PM UTC+2, Lubomir Konstantinov wrote: > > Bad case of copy pasta? > > You have am extra namespace definition: > > (ns dbns > (:require [clojure.java.jdbc :as jdbc] > [mysql/mysql-connector-java "5.1.38"])) > > You need to remove it, and move the require clause up in your ns: > > (ns jclojure.core > (:gen-class) > (:require [clojure.java.jdbc :as jdbc] > [mysql/mysql-connector-java "5.1.38"])) > > On Thursday, 19 October 2017 13:37:08 UTC+3, Damien Mattei wrote: >> >> hello again, >> >> i tried dozen of web example about mysql and clojure but it doen't work, >> here is some of my code: >> >> for dependencies: >> >> (defproject jclojure "0.1.0-SNAPSHOT" >> :description "clojure JVM source code for Sidonie web interface >> administration" >> :url "https://sidonie.oca.eu; >> :license {:name "Eclipse Public License" >> :url "http://www.eclipse.org/legal/epl-v10.html"} >> >> :dependencies [ >> [org.clojure/clojure "1.8.0"] >> [mysql/mysql-connector-java "5.1.38"] >> [org.clojure/java.jdbc "0.7.3"] >> ] >> >> :main ^:skip-aot jclojure.core >> :target-path "target/%s" >> :profiles {:uberjar {:aot :all}}) >> >> >> the code (some of...): >> >> (ns jclojure.core >> (:gen-class)) >> >> (defn -main >> "I don't do a whole lot ... yet." >> [& args] >> >> ;(:require [clojure.java [jdbc :as sql]]) >> >> ;(require '[clojure.java.jdbc :as jdbc]) >> >> (ns dbns >> (:require [clojure.java.jdbc :as jdbc] >> [mysql/mysql-connector-java "5.1.38"])) >> >> ;(use 'clojure.java.jdbc) >> >> (println "Hello, World!") >> >> (let [ >> db-host "localhost" >> db-port 3306 >> db-name "sidonie" >> ] >> >> (def db { >> :classname "com.mysql.jdbc.Driver" ; must be in classpath >> :subprotocol "mysql" >> :subname (str "//" db-host ":" db-port "
mysql and clojure
hello again, i tried dozen of web example about mysql and clojure but it doen't work, here is some of my code: for dependencies: (defproject jclojure "0.1.0-SNAPSHOT" :description "clojure JVM source code for Sidonie web interface administration" :url "https://sidonie.oca.eu; :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [ [org.clojure/clojure "1.8.0"] [mysql/mysql-connector-java "5.1.38"] [org.clojure/java.jdbc "0.7.3"] ] :main ^:skip-aot jclojure.core :target-path "target/%s" :profiles {:uberjar {:aot :all}}) the code (some of...): (ns jclojure.core (:gen-class)) (defn -main "I don't do a whole lot ... yet." [& args] ;(:require [clojure.java [jdbc :as sql]]) ;(require '[clojure.java.jdbc :as jdbc]) (ns dbns (:require [clojure.java.jdbc :as jdbc] [mysql/mysql-connector-java "5.1.38"])) ;(use 'clojure.java.jdbc) (println "Hello, World!") (let [ db-host "localhost" db-port 3306 db-name "sidonie" ] (def db { :classname "com.mysql.jdbc.Driver" ; must be in classpath :subprotocol "mysql" :subname (str "//" db-host ":" db-port "/" db-name) ; Any additional keys are passed to the driver ; as driver-specific properties. :user "mattei" :password "sidonie2"})) ;(jdbc/query db ["SELECT * FROM Sigles"]) (jdbc/with-connection db (jdbc/with-query-results rows ["select * from Sigles"] (println rows))) ) and now the error: [mattei@moita jclojure]$ lein run Exception in thread "main" java.lang.RuntimeException: No such namespace: jdbc, compiling:(jclojure/core.clj:37:3) at clojure.lang.Compiler.analyze(Compiler.java:6688) at clojure.lang.Compiler.analyze(Compiler.java:6625) at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3766) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6870) at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.analyze(Compiler.java:6625) at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001) at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380) at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866) at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6856) at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.access$300(Compiler.java:38) at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:589) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868) at clojure.lang.Compiler.analyze(Compiler.java:6669) at clojure.lang.Compiler.analyze(Compiler.java:6625) at clojure.lang.Compiler.eval(Compiler.java:6931) at clojure.lang.Compiler.load(Compiler.java:7379) at clojure.lang.RT.loadResourceScript(RT.java:372) at clojure.lang.RT.loadResourceScript(RT.java:363) at clojure.lang.RT.load(RT.java:453) at clojure.lang.RT.load(RT.java:419) at clojure.core$load$fn__5677.invoke(core.clj:5893) at clojure.core$load.invokeStatic(core.clj:5892) at clojure.core$load.doInvoke(core.clj:5876) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5697) at clojure.core$load_one.invoke(core.clj:5692) at clojure.core$load_lib$fn__5626.invoke(core.clj:5737) at clojure.core$load_lib.invokeStatic(core.clj:5736) at clojure.core$load_lib.doInvoke(core.clj:5717) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invokeStatic(core.clj:648) at clojure.core$load_libs.invokeStatic(core.clj:5774) at clojure.core$load_libs.doInvoke(core.clj:5758) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:648) at clojure.core$require.invokeStatic(core.clj:5796) at clojure.core$require.doInvoke(core.clj:5796) at clojure.lang.RestFn.invoke(RestFn.java:408) at user$eval5$fn__7.invoke(form-init7437695112761150837.clj:1) at user$eval5.invokeStatic(form-init7437695112761150837.clj:1) at user$eval5.invoke(form-init7437695112761150837.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6927) at clojure.lang.Compiler.eval(Compiler.java:6917) at clojure.lang.Compiler.load(Compiler.java:7379) at clojure.lang.Compiler.loadFile(Compiler.java:7317) at clojure.main$load_script.invokeStatic(main.clj:275) at clojure.main$init_opt.invokeStatic(main.clj:277) at clojure.main$init_opt.invoke(main.clj:277) at
Re: hello world question !!!
following this tutorial : https://github.com/technomancy/leiningen/blob/stable/doc/TUTORIAL.md#tutorial i succeed with leiningen to build a project,run it and after make a jar file : lein new app my-stuff cd my-stuff lein uberjar lein run or : cd target; java -jar my-stuff-0.1.0-SNAPSHOT-standalone.jar with some simplified from tutorial files: project.clj (defproject my-stuff "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "http://example.com/FIXME; :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"]] :main my-stuff.core :aot [my-stuff.core]) core.clj (ns my-stuff.core (:gen-class)) (defn -main [& args] (println "Welcome to my project! These are your args:" args)) the jar file in target/ could be loaded in the netbeans project Netbeans as a library/jar file and i can see the classes and definition in the netbeans IDE, so it seems ok, note that at this point i can test it (on the tomcat server) but it should work (if i add also the clojure.jar runtime library i suppose) also i do not need to make a full .war file from scratch, so it is more easy. thank for your help Damien On Monday, October 16, 2017 at 8:10:24 AM UTC+2, Terje Sten Bjerkseth wrote: > > Damien: A good starting point for a simple web server might be to use > > lein new pedestal-service > > Then you can do lein uberjar to get a jar ready to run. Or check the > README for running local dev with a local REPL. > > If instead you want a WAR, you can switch from pedestal.jetty to > pedestal.immutant in project.clj and add the Immutant plugin: > > :plugins [[lein-immutant "2.1.0"]] > > Then do a lein immutant war to get your WAR for deployment to e.g. WildFly > 10. > > If you also want a nREPL to repl directly into the running server, have in > project.clj e.g.: > > :plugins [[lein-immutant "2.1.0"] [cider/cider-nrepl "0.15.1"]] > :immutant {:war {:nrepl {:port }}} > > and do a lein immutant war --nrepl-start when making your WAR (check your > security on the nREPL port). > > Cheers, > Terje > > (Haven't looked at WildFly 11 RC yet and don't know if Immutant works with > it. Considering moving some of our services from WildFly to separate Jetty > services instead, but WildFly 10 has worked very well.) > > > > søndag 15. oktober 2017 10.43.36 UTC+2 skrev Damien Mattei følgende: >> >> thanks for the answers and comments of John, James and others, >> the discussion has opened many aspect of web application development and >> it is is positive. >> >> about the IDE, i'm not using Netbeans with Scheme or LisP exclusively, in >> fact Netbeans was used in the office just to create web service in Java, >> this thing can be done by hand in command line too, Kawa Scheme also can >> do it itself : >> https://www.gnu.org/software/kawa/Servlets.html >> >> from the discussion i see now many solution to test ,I will install >> Leiningen, also i see in the doc of Immutant that it is possible to >> generate some war files : >> http://immutant.org/documentation/current/apidoc/guide-wildfly.html#h3386 >> >> i hope i could use Clojure for that because it seems a really fun and >> solid LisP dialect. >> I will post updates when i have a concrete usable solution. >> >> Regards, >> >> Damien >> >> On Saturday, October 14, 2017 at 5:07:08 PM UTC+2, John M. Switlik wrote: >>> >>> James, >>> >>> Thanks. I saw a writeup mentioning Leiningen that I will go back to. >>> >>> It is not the 'toy' issue that concerns me. It is that all sorts of >>> browsers exist as well as a whole slew of different types of users. And, if >>> I am going to push something down to a remote device, I want to expect that >>> it would be handled in a nice manner. >>> >>> As for example projects, these are prime; but, they are supported by >>> working professionals. So, Clojure does have a lot to offer. >>> >>>http://base2s.com/work/ >>> >>> I am sure that I'll look back and see that it was easy. But, this seems >>> like an opportunity to step through the thing (that is, the hugely >>> complicated world of the muddy cloud) and see how things evolved. Those >>> little interpreters are up there as a lure in the meantime. >>> >>> Cheers, >>> John >>> >> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to
Re: hello world question !!!
thanks for the answers and comments of John, James and others, the discussion has opened many aspect of web application development and it is is positive. about the IDE, i'm not using Netbeans with Scheme or LisP exclusively, in fact Netbeans was used in the office just to create web service in Java, this thing can be done by hand in command line too, Kawa Scheme also can do it itself : https://www.gnu.org/software/kawa/Servlets.html from the discussion i see now many solution to test ,I will install Leiningen, also i see in the doc of Immutant that it is possible to generate some war files : http://immutant.org/documentation/current/apidoc/guide-wildfly.html#h3386 i hope i could use Clojure for that because it seems a really fun and solid LisP dialect. I will post updates when i have a concrete usable solution. Regards, Damien On Saturday, October 14, 2017 at 5:07:08 PM UTC+2, John M. Switlik wrote: > > James, > > Thanks. I saw a writeup mentioning Leiningen that I will go back to. > > It is not the 'toy' issue that concerns me. It is that all sorts of > browsers exist as well as a whole slew of different types of users. And, if > I am going to push something down to a remote device, I want to expect that > it would be handled in a nice manner. > > As for example projects, these are prime; but, they are supported by > working professionals. So, Clojure does have a lot to offer. > >http://base2s.com/work/ > > I am sure that I'll look back and see that it was easy. But, this seems > like an opportunity to step through the thing (that is, the hugely > complicated world of the muddy cloud) and see how things evolved. Those > little interpreters are up there as a lure in the meantime. > > Cheers, > John > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: hello world question !!!
@andy to deploy the WAR file , i also use Netbeans to create it with java files, the .scm scheme, files are .class files ( https://github.com/damien-mattei/Jkawa/tree/master/eu/oca/kawafunct )precompiled with Kawa scheme ( https://github.com/damien-mattei/Jkawa )and ,Bigloo scheme ( https://github.com/damien-mattei/Jbigl )compilers to JVM byte code and after packaged in .jar files , also i need to add the runtime library of each language, one for kawa and another for bigloo, they must be packaged in .jar files (not .zip) also; i have a draft that explain this: https://sidonie.oca.eu/Sidonie/technical-doc.html i almost sure that if i got some clojure source file that i can compile it to JVM .class files and make .jar files of them they can be exported in a .war files as a library in my Netbeans project the way it was for Kawa and Bigloo, if clojure use a runtime library (and i suppose it's yes) this library should be packaged in a.jar file and add also in the .war file On Friday, October 13, 2017 at 10:13:24 PM UTC+2, Andy Fingerhut wrote: > > I haven't deployed an application written in Clojure to a server as a WAR > file before, so can't speak from experience, but I am sure others here > probably can. Hey, others, have you deployed a Clojure application via a > WAR file without using AOT compilation, with only Clojure source code > packaged in the WAR file? Is that something that works? > > Andy > > On Fri, Oct 13, 2017 at 11:05 AM, Damien Mattei <damien...@gmail.com > > wrote: > >> but i am in this situation, i wrote application in Scheme (Kawa,Bigloo) >> ,LisP that ran on an apache tomcat server, the application is deplyed in >> war files , they are precompiled ,with Kawa or Bigloo Scheme, and also use >> regular Java class compiled with Java8. >> They never ran in REPL ,all the test and debug must be done on the host >> that run tomcat web server in Java 8, here is the site : >> https://sidonie.oca.eu/ >> >> On Friday, October 13, 2017 at 7:37:08 PM UTC+2, Andy Fingerhut wrote: >>> >>> Just a note that at the top of the documentation page you mention, it >>> says: "Clojure compiles all code you load on-the-fly into JVM bytecode, >>> but sometimes it is advantageous to compile ahead-of-time (AOT)." >>> >>> I would venture an estimate that most people who use Clojure do so >>> without using AOT compilation. Many would advocate against using AOT >>> compilation, unless you are in a particular situation that requires it. >>> >>> Andy >>> >>> On Fri, Oct 13, 2017 at 10:13 AM, Damien Mattei <damien...@gmail.com> >>> wrote: >>> >>>> i did not have , i just follow the tutorial: >>>> https://clojure.org/reference/compilation >>>> i made the file but still the same problem: >>>> >>>> [mattei@moita ~]$ export CLASSPATH=.:./clojure/examples >>>> [mattei@moita ~]$ clojure >>>> Clojure 1.5.1 >>>> user=> (compile 'clojure.examples.hello) >>>> FileNotFoundException Could not locate >>>> clojure/examples/hello__init.class or clojure/examples/hello.clj on >>>> classpath: clojure.lang.RT.load (RT.java:443) >>>> user=> ^C[mattei@moita ~]$ >>>> >>>> [mattei@moita ~]$ cat clojure/examples/hello.clj >>>> (ns clojure.examples.hello >>>> (:gen-class)) >>>> >>>> (defn -main >>>> [greetee] >>>> (println (str "Hello " greetee "!"))) >>>> >>>> On Friday, October 13, 2017 at 4:48:40 PM UTC+2, James Reeves wrote: >>>>> >>>>> Maybe this is a dumb question, but do you have a file >>>>> "clojure/examples/hello.clj" on the classpath? Since that's what the >>>>> exception is complaining about. >>>>> >>>>> On 13 October 2017 at 15:09, Damien Mattei <damien...@gmail.com> >>>>> wrote: >>>>> >>>>>> hello, >>>>>> >>>>>> i'm new to clojure, just installed it on a CentOS box, >>>>>> >>>>>> and try to compile the code below from tutorial, but it does not >>>>>> work, i searched a lot before posting, no answer... i do not want to use >>>>>> leiningen at this stage,later perheaps... >>>>>> >>>>>> just want to compile and run >>>>>> >>>>>> user=> (ns clojure.examples.hello >>>>>> (:gen-class)) >>>>>> ni
Re: hello world question !!!
@james i also try to set the CLASSPATH at src but it does noot work, i will try Leiningen monday Regards, Damien On Friday, October 13, 2017 at 9:12:55 PM UTC+2, James Reeves wrote: > > The docstring for compile > <https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/compile> > > says that "The source for the lib must be in a proper > classpath-relative directory", so unfortunately you can't just create the > namespace in the REPL and compile it from there. The tutorial on the > Clojure site doesn't make that as clear as it could be. > > In your revised example, you're setting the classpath incorrectly. The > classpath should contain the root of your file tree. For example, if you > have the file path "src/clojure/examples/hello.clj", then the classpath > should be set to "src". > > I'm not sure how the "clojure" script you're running works, but you might > find Leiningen to be a better starting point. In Clojure 1.9, an official > "clj" script is going to be introduced, which might make this process > easier. Until then, Leiningen is probably the safer bet. > > On 13 October 2017 at 18:13, Damien Mattei <damien...@gmail.com > > wrote: > >> i did not have , i just follow the tutorial: >> https://clojure.org/reference/compilation >> i made the file but still the same problem: >> >> [mattei@moita ~]$ export CLASSPATH=.:./clojure/examples >> [mattei@moita ~]$ clojure >> Clojure 1.5.1 >> user=> (compile 'clojure.examples.hello) >> FileNotFoundException Could not locate clojure/examples/hello__init.class >> or clojure/examples/hello.clj on classpath: clojure.lang.RT.load >> (RT.java:443) >> user=> ^C[mattei@moita ~]$ >> >> [mattei@moita ~]$ cat clojure/examples/hello.clj >> (ns clojure.examples.hello >> (:gen-class)) >> >> (defn -main >> [greetee] >> (println (str "Hello " greetee "!"))) >> >> On Friday, October 13, 2017 at 4:48:40 PM UTC+2, James Reeves wrote: >>> >>> Maybe this is a dumb question, but do you have a file >>> "clojure/examples/hello.clj" on the classpath? Since that's what the >>> exception is complaining about. >>> >>> On 13 October 2017 at 15:09, Damien Mattei <damien...@gmail.com> wrote: >>> >>>> hello, >>>> >>>> i'm new to clojure, just installed it on a CentOS box, >>>> >>>> and try to compile the code below from tutorial, but it does not work, >>>> i searched a lot before posting, no answer... i do not want to use >>>> leiningen at this stage,later perheaps... >>>> >>>> just want to compile and run >>>> >>>> user=> (ns clojure.examples.hello >>>> (:gen-class)) >>>> nil >>>> clojure.examples.hello=> >>>> clojure.examples.hello=> (defn -main >>>> [greetee] >>>> (println (str "Hello " greetee "!"))) >>>> #'clojure.examples.hello/-main >>>> clojure.examples.hello=> (compile 'clojure.examples.hello) >>>> FileNotFoundException Could not locate >>>> clojure/examples/hello__init.class or clojure/examples/hello.clj on >>>> classpath: clojure.lang.RT.load (RT.java:443) >>>> >>>> help greatly appreciated (because i'm just one step to leave Clojure >>>> and continue using Kawa or Bigloo i already use or dive into ABCL , but >>>> Clojure has a so good reputation, i cannot imagine being sticked here by a >>>> simple hello world!) >>>> >>>> damien >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To post to this group, send email to clo...@googlegroups.com >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> clojure+u...@googlegroups.com >>>> For more options, visit this group at >>>> http://groups.google.com/group/clojure?hl=en >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to clojure+u...@googlegroups.com. >>>> For more options, visit https://groups.goo
Re: hello world question !!!
but i am in this situation, i wrote application in Scheme (Kawa,Bigloo) ,LisP that ran on an apache tomcat server, the application is deplyed in war files , they are precompiled ,with Kawa or Bigloo Scheme, and also use regular Java class compiled with Java8. They never ran in REPL ,all the test and debug must be done on the host that run tomcat web server in Java 8, here is the site : https://sidonie.oca.eu/ On Friday, October 13, 2017 at 7:37:08 PM UTC+2, Andy Fingerhut wrote: > > Just a note that at the top of the documentation page you mention, it > says: "Clojure compiles all code you load on-the-fly into JVM bytecode, > but sometimes it is advantageous to compile ahead-of-time (AOT)." > > I would venture an estimate that most people who use Clojure do so without > using AOT compilation. Many would advocate against using AOT compilation, > unless you are in a particular situation that requires it. > > Andy > > On Fri, Oct 13, 2017 at 10:13 AM, Damien Mattei <damien...@gmail.com > > wrote: > >> i did not have , i just follow the tutorial: >> https://clojure.org/reference/compilation >> i made the file but still the same problem: >> >> [mattei@moita ~]$ export CLASSPATH=.:./clojure/examples >> [mattei@moita ~]$ clojure >> Clojure 1.5.1 >> user=> (compile 'clojure.examples.hello) >> FileNotFoundException Could not locate clojure/examples/hello__init.class >> or clojure/examples/hello.clj on classpath: clojure.lang.RT.load >> (RT.java:443) >> user=> ^C[mattei@moita ~]$ >> >> [mattei@moita ~]$ cat clojure/examples/hello.clj >> (ns clojure.examples.hello >> (:gen-class)) >> >> (defn -main >> [greetee] >> (println (str "Hello " greetee "!"))) >> >> On Friday, October 13, 2017 at 4:48:40 PM UTC+2, James Reeves wrote: >>> >>> Maybe this is a dumb question, but do you have a file >>> "clojure/examples/hello.clj" on the classpath? Since that's what the >>> exception is complaining about. >>> >>> On 13 October 2017 at 15:09, Damien Mattei <damien...@gmail.com> wrote: >>> >>>> hello, >>>> >>>> i'm new to clojure, just installed it on a CentOS box, >>>> >>>> and try to compile the code below from tutorial, but it does not work, >>>> i searched a lot before posting, no answer... i do not want to use >>>> leiningen at this stage,later perheaps... >>>> >>>> just want to compile and run >>>> >>>> user=> (ns clojure.examples.hello >>>> (:gen-class)) >>>> nil >>>> clojure.examples.hello=> >>>> clojure.examples.hello=> (defn -main >>>> [greetee] >>>> (println (str "Hello " greetee "!"))) >>>> #'clojure.examples.hello/-main >>>> clojure.examples.hello=> (compile 'clojure.examples.hello) >>>> FileNotFoundException Could not locate >>>> clojure/examples/hello__init.class or clojure/examples/hello.clj on >>>> classpath: clojure.lang.RT.load (RT.java:443) >>>> >>>> help greatly appreciated (because i'm just one step to leave Clojure >>>> and continue using Kawa or Bigloo i already use or dive into ABCL , but >>>> Clojure has a so good reputation, i cannot imagine being sticked here by a >>>> simple hello world!) >>>> >>>> damien >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To post to this group, send email to clo...@googlegroups.com >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> clojure+u...@googlegroups.com >>>> For more options, visit this group at >>>> http://groups.google.com/group/clojure?hl=en >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to clojure+u...@googlegroups.com. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> James Reeves >>> booleanknot.com >>> >> -- >> You received this message because you are subscribed
Re: hello world question !!!
yes i had tested . (point) in classpath and later added clojure/example which is not a good idea as the namespace is already clojure.examples.hello, already clojure.examples will be converted in clojure/examples but what must i do then? where must i put this hello.clj: (ns clojure.examples.hello (:gen-class)) (defn -main [greetee] (println (str "Hello " greetee "!"))) to compile it with this command: [mattei@moita ~]$ clojure Clojure 1.5.1 user=> (compile 'clojure.examples.hello) for example in Kawa i put this in a Scheme class file: *(module-name "eu.oca.kawafunct.Counter")and the class is compiled in **eu/oca/kawafunct* what will be the good CLASSPATH so ? On Friday, October 13, 2017 at 7:23:24 PM UTC+2, Justin Smith wrote: > > paths have to reflect the package and be relative to the class path, so if > "clojure/examples" is on the classpath, and the namespace is > clojure.examples.hello, the file needs to be in > "clojure/examples/clojure/examples/hello.clj" > > On Fri, Oct 13, 2017 at 10:13 AM Damien Mattei <damien...@gmail.com > > wrote: > >> i did not have , i just follow the tutorial: >> https://clojure.org/reference/compilation >> i made the file but still the same problem: >> >> [mattei@moita ~]$ export CLASSPATH=.:./clojure/examples >> [mattei@moita ~]$ clojure >> Clojure 1.5.1 >> user=> (compile 'clojure.examples.hello) >> >> FileNotFoundException Could not locate clojure/examples/hello__init.class >> or clojure/examples/hello.clj on classpath: clojure.lang.RT.load >> (RT.java:443) >> user=> ^C[mattei@moita ~]$ >> >> [mattei@moita ~]$ cat clojure/examples/hello.clj >> (ns clojure.examples.hello >> (:gen-class)) >> >> >> (defn -main >> [greetee] >> (println (str "Hello " greetee "!"))) >> >> On Friday, October 13, 2017 at 4:48:40 PM UTC+2, James Reeves wrote: >> >>> Maybe this is a dumb question, but do you have a file >>> "clojure/examples/hello.clj" on the classpath? Since that's what the >>> exception is complaining about. >>> >> On 13 October 2017 at 15:09, Damien Mattei <damien...@gmail.com> wrote: >>> >> hello, >>>> >>>> i'm new to clojure, just installed it on a CentOS box, >>>> >>>> and try to compile the code below from tutorial, but it does not work, >>>> i searched a lot before posting, no answer... i do not want to use >>>> leiningen at this stage,later perheaps... >>>> >>>> just want to compile and run >>>> >>>> user=> (ns clojure.examples.hello >>>> (:gen-class)) >>>> nil >>>> clojure.examples.hello=> >>>> clojure.examples.hello=> (defn -main >>>> [greetee] >>>> (println (str "Hello " greetee "!"))) >>>> #'clojure.examples.hello/-main >>>> clojure.examples.hello=> (compile 'clojure.examples.hello) >>>> FileNotFoundException Could not locate >>>> clojure/examples/hello__init.class or clojure/examples/hello.clj on >>>> classpath: clojure.lang.RT.load (RT.java:443) >>>> >>>> help greatly appreciated (because i'm just one step to leave Clojure >>>> and continue using Kawa or Bigloo i already use or dive into ABCL , but >>>> Clojure has a so good reputation, i cannot imagine being sticked here by a >>>> simple hello world!) >>>> >>>> damien >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> >>> To post to this group, send email to clo...@googlegroups.com >>> >>> >>>> Note that posts from new members are moderated - please be patient with >>>> your first post. >>>> To unsubscribe from this group, send email to >>>> >>> clojure+u...@googlegroups.com >>> >>> >>>> For more options, visit this group at >>>> http://groups.google.com/group/clojure?hl=en >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "Clojure" group. >>>> >>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to clojure+u...@googlegroups.com. >>> >>> >>>> For more options, visit https://groups.google.com/d/optout.
Re: hello world question !!!
i did not have , i just follow the tutorial: https://clojure.org/reference/compilation i made the file but still the same problem: [mattei@moita ~]$ export CLASSPATH=.:./clojure/examples [mattei@moita ~]$ clojure Clojure 1.5.1 user=> (compile 'clojure.examples.hello) FileNotFoundException Could not locate clojure/examples/hello__init.class or clojure/examples/hello.clj on classpath: clojure.lang.RT.load (RT.java:443) user=> ^C[mattei@moita ~]$ [mattei@moita ~]$ cat clojure/examples/hello.clj (ns clojure.examples.hello (:gen-class)) (defn -main [greetee] (println (str "Hello " greetee "!"))) On Friday, October 13, 2017 at 4:48:40 PM UTC+2, James Reeves wrote: > > Maybe this is a dumb question, but do you have a file > "clojure/examples/hello.clj" on the classpath? Since that's what the > exception is complaining about. > > On 13 October 2017 at 15:09, Damien Mattei <damien...@gmail.com > > wrote: > >> hello, >> >> i'm new to clojure, just installed it on a CentOS box, >> >> and try to compile the code below from tutorial, but it does not work, i >> searched a lot before posting, no answer... i do not want to use leiningen >> at this stage,later perheaps... >> >> just want to compile and run >> >> user=> (ns clojure.examples.hello >> (:gen-class)) >> nil >> clojure.examples.hello=> >> clojure.examples.hello=> (defn -main >> [greetee] >> (println (str "Hello " greetee "!"))) >> #'clojure.examples.hello/-main >> clojure.examples.hello=> (compile 'clojure.examples.hello) >> FileNotFoundException Could not locate clojure/examples/hello__init.class >> or clojure/examples/hello.clj on classpath: clojure.lang.RT.load >> (RT.java:443) >> >> help greatly appreciated (because i'm just one step to leave Clojure and >> continue using Kawa or Bigloo i already use or dive into ABCL , but >> Clojure has a so good reputation, i cannot imagine being sticked here by a >> simple hello world!) >> >> damien >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clo...@googlegroups.com >> >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+u...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+u...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > James Reeves > booleanknot.com > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
hello world question !!!
hello, i'm new to clojure, just installed it on a CentOS box, and try to compile the code below from tutorial, but it does not work, i searched a lot before posting, no answer... i do not want to use leiningen at this stage,later perheaps... just want to compile and run user=> (ns clojure.examples.hello (:gen-class)) nil clojure.examples.hello=> clojure.examples.hello=> (defn -main [greetee] (println (str "Hello " greetee "!"))) #'clojure.examples.hello/-main clojure.examples.hello=> (compile 'clojure.examples.hello) FileNotFoundException Could not locate clojure/examples/hello__init.class or clojure/examples/hello.clj on classpath: clojure.lang.RT.load (RT.java:443) help greatly appreciated (because i'm just one step to leave Clojure and continue using Kawa or Bigloo i already use or dive into ABCL , but Clojure has a so good reputation, i cannot imagine being sticked here by a simple hello world!) damien -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.