liebke / cljr Goto Github PK
View Code? Open in Web Editor NEWcljr is a Clojure REPL and package management system.
cljr is a Clojure REPL and package management system.
Messages such as "Clojure classpath initialized by cljr." are printing to stdout. They should print to stderr so that they do not appear in uses like $ cljr run foo.clj > foo.txt
I'd like to work with the latest clojure.jar and clojure-contrib.jar files that I've built from their respective repos, how do I get clj to use them?
When I run 'clj repl', I am unable to paste the characters "ใใ" (they show up as "??" instead). When I remove Jline from the REPL command, I can type them without a problem.
Maybe an environment variable like CLJ_ENABLE_JLINE=false or a different command like 'clj utf-repl' to spawn a REPL without jline?
hi,
could you do a comparison with leiningen ? Most of clojure's better known projects (leiningen, -> compojure <-, ring, cascalog) use lein as their default management tool. Could you give similar bootstrap examples for these tools as well ?
clj installs very fine on my own laptop (thanks!), but it seems to have issues connecting at the institute. Could it be that it doesn't handle connection through an http-proxy yet?
I installed cljr on Ubuntu 10.10 using java -jar cljr-installer.jar, but my system isn't finding the command to execute. What am I missing?
$ echo $PATH
$HOME/.cljr/bin:$HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin
$ ls -l ~/.cljr
drwxr-xr-x 5 david 4096 2011-01-31 15:02 .
drwxr-xr-x 80 david 4096 2011-01-31 15:31 ..
drwxr-xr-x 2 david 4096 2011-01-31 15:28 bin
-rw-r--r-- 1 david 7187869 2011-01-31 15:02 cljr.jar
drwxr-xr-x 2 david 4096 2011-01-31 15:29 lib
-rw-r--r-- 1 david 412 2011-01-31 15:28 project.clj
drwxr-xr-x 2 david 4096 2011-01-31 15:02 src
$ whoami
david
$ cl[TAB]
cleanasn clear_console cli-gacutil clojure clojure-repl
clear cli cljr clojurec
$ cljr help
cljr: command not found
$ ~/.cljr/bin/cljr help
... ... (functions correctly)
cljr should install clojure{,-contrib} 1.2.0 by default, not beta1
The generated clj.bat file contains -Duser.home=C:\Documents and Settings.. etc. on windows XP. The path needs quotes.
classpath does not appear to get set correctly on cygwin.
$ cljr list Exception in thread "main" java.lang.NoClassDefFoundError: cljr/App ..etc.. $ cljr repl Exception in thread "main" java.lang.NoClassDefFoundError: jline/ConsoleRunner ..etc..
Maybe something like
cygwin=false case "`uname`" in CYGWIN*) cygwin=true;; esac
test
if $cygwin; then cygwin cmds else unix/linux cmds fi
cygwin versions of classpath setting statements.
CLASSPATH="src;test;." CLASSPATH="$CLASSPATH"\;"$CLJR_HOME"/cljr.jar CLASSPATH="$CLASSPATH"\;$f (2 places)
I'm behind a proxy at work (running Windows 7 x64) so I tried setting JVM_OPTS as you mentioned in the closed ticket about proxy support but it didn't work. I went ahead and just ran the self-install from the command line using the same parameters that I put in JVM_OPTS and it installed fine.
I hoped that maybe now that it was installed it would use JVM_OPTS, but trying to install Incanter (via cljr install incanter) failed due to the proxy again.
Steps to reproduce:
Install
Download cljr-installer.jar
Run java -jar cljr-installer.jar
Note 1: If your browser added a .zip extension to the jar during download, just run: java -jar cljr-installer.jar.zip.
Note 2: Requires java 1.6
Add ~/.cljr/bin/ to your path (or copy the platform appropriate cljr script to your path).
cljr search leiningen
Actual results:
cljr search cljr
Libraries on Clojars.org that contain the term: cljr
--------------------------------------------------------------------------------
cljr search leiningen
Libraries on Clojars.org that contain the term: leiningen
--------------------------------------------------------------------------------
Expected results:
something that's not blank.
First time cljr user here, I'm not sure yet what it has to display instead.
Latest and greatest - it appears cljr uses 1.2 beta.
Downloading: org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom from clojure
Downloading: org/clojure/clojure/1.1.0-alpha-SNAPSHOT/clojure-1.1.0-alpha-SNAPSHOT.pom from clojure-snapshots
...
Created /Users/me/Documents/clj/clj.jar
Including clj.jar
Including ant-1.6.2.jar
Including ant-launcher-1.6.2.jar
...
However, in the "creating scripts" step, I get the following error:
No matching method found: setExecutable for class java.io.File
Here are the last line sent to the screen:
...
Including wagon-provider-api-1.0-beta-2.jar
Including xml-apis-1.0.b2.jar
/Users/me/.clj / project.clj does not exist, clj must be initialized.
The /Users/me/.clj/lib/ repository does not exist, needs to be initialized.
--------------------------------------------------------------------------------
Initializing clj...
Creating clj home, /Users/me/.clj ...
Copying clj-standalone.jar to /Users/me/.clj/clj.jar...
Creating /Users/me/.clj/project.clj file...
Creating script files...
Exception in thread "main" java.lang.IllegalArgumentException: No matching method found: setExecutable for class java.io.File
at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:50)
at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28)
at clj.main$clj_self_install.invoke(main.clj:249)
at clj.main$clj.doInvoke(main.clj:451)
at clojure.lang.RestFn.invoke(RestFn.java:411)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:133)
at clojure.core$apply.invoke(core.clj:540)
at clj.main$_main.doInvoke(main.clj:475)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clj.main.main(Unknown Source)
The installation worked yesterday on my other laptop. Could this have to do with the fact that I'm on another network now than yesterday? Or has something changed in the code?
(OT: Github puts a .zip extension when downloading the jar file with Chrome on MacOSX)
Two stacktraces. The first happened on the first install attempt and the second happens on each subsequent attempt. Timestamp is 2010-06-26 06:45 EST
% java -jar clj-1.0.0-SNAPSHOT-standalone.jar.zip self-install
java -jar clj-1.0.0-SNAPSHOT-standalone.jar.zip self-install
/Users/seths/.clj / project.clj does not exist, clj must be initialized.
Initializing clj...
Creating clj home, /Users/seths/.clj ...
Copying to /Users/seths/.clj/clj.jar...
Exception in thread "main" java.lang.IllegalArgumentException: No method in multimethod 'do-copy' for dispatch value: [nil java.io.File]
at clojure.lang.MultiFn.getFn(MultiFn.java:121)
at clojure.lang.MultiFn.invoke(MultiFn.java:171)
at clojure.java.io$copy.doInvoke(io.clj:383)
at clojure.lang.RestFn.invoke(RestFn.java:426)
at clj.main$clj_self_install.invoke(main.clj:243)
at clj.main$clj.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:411)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:133)
at clojure.core$apply.invoke(core.clj:540)
at clj.main$_main.doInvoke(main.clj:443)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clj.main.main(Unknown Source)
% java -jar clj-1.0.0-SNAPSHOT-standalone.jar self-install
java -jar clj-1.0.0-SNAPSHOT-standalone.jar self-install
/Users/seths/.clj / project.clj does not exist, clj must be initialized.
Exception in thread "main" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.net.URL;
at clj.main$add_clj_repo_to_classpath.invoke(main.clj:214)
at clj.main$add_clj_repo_to_classpath.invoke(main.clj:201)
at clj.main$clj.doInvoke(main.clj:417)
at clojure.lang.RestFn.invoke(RestFn.java:411)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.RestFn.applyTo(RestFn.java:133)
at clojure.core$apply.invoke(core.clj:540)
at clj.main$_main.doInvoke(main.clj:443)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clj.main.main(Unknown Source)
I don't really like the swingrepl. :-)
With most other interactive interpreter programs (python, irb, etc), the REPL is started in the console. It always throws me off when I run cljr and get a swing REPL. What would be awesome is if I could customize cljr so that the regular console-based REPL is the default.
After installing some libraries I was surprised to find they didn't work, upon investigating I see that ~/.cljr/lib isn't actually being included on the classpath in either ~/.cljr/bin/cljr or ~/.cljr/bin/cljr.bat.
I saw that this used to be an issue for Cygwin -- I'm getting it now on OS X Snow Leopard. Very odd!
Steps used to install --
cljr list
works fine... cljr swank
causes
Caused by: java.lang.ClassNotFoundException: cljr.App
Oh, after some playing around, I can note that cljr clean
followed by cljr reload
fixes this issue.
I have some code I would like to test from the REPL, it requires 1gb of space allocated in order not to overflow the heap.
I'd like to be able to do something like:
export CLJ_OPTS="-server -Xmx1024m"
and have clj respect those options.
$ script/install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building cljr
[INFO] task-segment: [clean]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-jar-plugin/2.2/maven-jar-plugin-2.2.jar
[INFO] [clean:clean {execution: default-clean}]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Wed Sep 15 09:11:21 EDT 2010
[INFO] Final Memory: 6M/81M
[INFO] ------------------------------------------------------------------------
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building cljr
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
Downloading: http://repo1.maven.org/maven2/org/apache/maven/plugins/maven-resources-plugin/2.3/maven-resources-plugin-2.3.pom
...
Downloading: http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-digest/1.0/plexus-digest-1.0.jar
[INFO] [install:install {execution: default-install}]
[INFO] Installing /Users/david/src/cljr/target/cljr-1.0.0-SNAPSHOT.jar to /Users/david/.m2/repository/cljr/cljr/1.0.0-SNAPSHOT/cljr-1.0.0-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8 minutes 46 seconds
[INFO] Finished at: Wed Sep 15 09:20:08 EDT 2010
[INFO] Final Memory: 26M/81M
[INFO] ------------------------------------------------------------------------
Cleaning up.
[INFO] snapshot cljr:cljr:1.0.0-SNAPSHOT: checking for updates from central
[INFO] snapshot cljr:cljr:1.0.0-SNAPSHOT: checking for updates from clojure
[INFO] snapshot cljr:cljr:1.0.0-SNAPSHOT: checking for updates from clojure-snapshots
[INFO] snapshot cljr:cljr:1.0.0-SNAPSHOT: checking for updates from clojars
Copying 30 files to /Users/david/src/cljr/installer/lib
Cleaning up.
Copying 30 files to /Users/david/src/cljr/installer/lib
Overriding previous definition of reference to cljr-installer
Overriding previous definition of reference to dependency.fileset
Copying 30 files to /Users/david/src/cljr/installer/lib
Created /Users/david/src/cljr/installer/cljr-installer-1.0.0-SNAPSHOT.jar
Including cljr-installer-1.0.0-SNAPSHOT.jar
Including ant-1.6.5.jar
Including ant-launcher-1.6.5.jar
Including classworlds-1.1-alpha-2.jar
Including cljr-1.0.0-SNAPSHOT.jar
Including clojure-1.2.0-beta1.jar
Including clojure-contrib-1.2.0-beta1.jar
Including jline-0.9.94.jar
Including jtidy-4aug2000r7-dev.jar
Including junit-3.8.1.jar
Including leiningen-1.1.0.jar
Including maven-ant-tasks-2.0.10.jar
Including maven-artifact-2.0.10.jar
Including maven-artifact-manager-2.0.10.jar
Including maven-error-diagnostics-2.0.10.jar
Including maven-model-2.0.10.jar
Including maven-plugin-registry-2.0.10.jar
Including maven-profile-2.0.10.jar
Including maven-project-2.0.10.jar
Including maven-repository-metadata-2.0.10.jar
Including maven-settings-2.0.10.jar
Including plexus-container-default-1.0-alpha-9-stable-1.jar
Including plexus-interpolation-1.1.jar
Including plexus-utils-1.5.5.jar
Including swank-clojure-1.2.1.jar
Including swingrepl-1.0.0-20100502.112537-4.jar
Including wagon-file-1.0-beta-2.jar
Including wagon-http-lightweight-1.0-beta-2.jar
Including wagon-http-shared-1.0-beta-2.jar
Including wagon-provider-api-1.0-beta-2.jar
Including xml-apis-1.0.b2.jar
Created /Users/david/src/cljr/installer/cljr-installer-1.0.0-SNAPSHOT-standalone.jar
Unable to access jarfile cljr-installer-standalone.jar
I'm running Ubuntu 10.04 without X installed:
daniel@lucid:~$ java -jar cljr-installer.jar
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173)
at java.awt.Window.(Window.java:437)
at java.awt.Frame.(Frame.java:419)
at javax.swing.JFrame.(JFrame.java:218)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:160)
at org.dipert.swingrepl.main$make_repl_jframe.invoke(main.clj:24)
at cljr.main$cljr_repl.invoke(main.clj:203)
at cljr.main$cljr.doInvoke(main.clj:293)
at clojure.lang.RestFn.invoke(RestFn.java:409)
at cljr.main$cljr.invoke(main.clj:277)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.RestFn.applyTo(RestFn.java:133)
at clojure.core$apply.invoke(core.clj:540)
at cljr.main$_main.invoke(main.clj:309)
at cljr.repl$_main.doInvoke(repl.clj:8)
at clojure.lang.RestFn.invoke(RestFn.java:398)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.RestFn.applyTo(RestFn.java:133)
at cljr.repl.main(Unknown Source)
Following the instructions, I download the file cljr-installer.jar and ran:
java -jar cljr-installer.jar
I am using Java 1.6_0_24.
Here is the output:
Downloading: org/clojure/clojure-contrib/1.2.0-beta1/clojure-contrib-1.2.0-beta1.pom from central
[INFO] snapshot cljr:cljr:1.0.0-SNAPSHOT: checking for updates from central
[null] An error has occurred while processing the Maven artifact tasks.
[null] Diagnosis:
[null]
[null] Unable to resolve artifact: Unable to get dependency information: Unable to read the metadata file for artifact 'cljr:cljr:jar': Error getting POM for 'cljr:cljr' from the repository: Unable to store local copy of metadata: Error updating group repository metadata
[null] cljr:cljr:pom:1.0.0-SNAPSHOT
[null]
[null]
[null] for project cljr:cljr
[null] cljr:cljr:jar:1.0.0-SNAPSHOT
[null]
[null] from the specified remote repositories:
[null] clojure (http://build.clojure.org/releases),
[null] clojars (http://clojars.org/repo/),
[null] clojure-snapshots (http://build.clojure.org/snapshots),
[null] central (http://repo1.maven.org/maven2)
[null]
[null] Path to dependency:
[null] 1) org.apache.maven:super-pom:jar:2.0
[null]
[null]
[null] /Users/lisperado/.m2/repository/cljr/cljr/1.0.0-SNAPSHOT/maven-metadata-central.xml (No such file or
directory)
Exception in thread "main" Unable to resolve artifact: Unable to get dependency information: Unable to read the
metadata file for artifact 'cljr:cljr:jar': Error getting POM for 'cljr:cljr' from the repository: Unable to store local copy of
metadata: Error updating group repository metadata cljr:cljr:pom:1.0.0-SNAPSHOT
for project cljr:cljr
cljr:cljr:jar:1.0.0-SNAPSHOT
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.