I suppose it could be a way to unify both versions using (System/ getProperty "path.separator") and (System/getProperty "file.separator") I add the leo changes (to master vesion -lesses changes-) and it works for me thanks!!
On Oct 12, 2:53 pm, leo <leonardo.lsilves...@gmail.com> wrote: > This works for me under Windows 7. I set all forward slashes paths in > my .emacs file like this: > > (progn > (setq cdt-dir "c:/msysgit/cdt") > (setq cdt-source-path "c:/clj/clojure-1.2.0/src/jvm;c:/clj/ > clojure-1.2.0/src/clj;c:/clj/clojure-contrib-1.2.0/src/main/clojure/ > clojure/contrib;") > (load-file (format "%s/ide/emacs/cdt.el" cdt-dir))) > > And these are the diffs from George's current windows version > (hopefully George will be able to make them available in a more > convenient way) - and note the "file:///" with 3 slashes under > Windows: > --------- > diff --git a/.gitignore b/.gitignore > diff --git a/README b/README > diff --git a/docs/cdt.muse b/docs/cdt.muse > diff --git a/docs/emacs-cdt.muse b/docs/emacs-cdt.muse > diff --git a/ide/emacs/cdt.el b/ide/emacs/cdt.el > index 0560ab2..42e3e1a 100644 > --- a/ide/emacs/cdt.el > +++ b/ide/emacs/cdt.el > @@ -25,13 +25,13 @@ > (gud-call (format "(reval-display '%s)" (thing-at-point 'sexp)))) > > (defun strip-trail (path) > - (if (= (elt path (- (length path) 1)) ?\\) > + (if (= (elt path (- (length path) 1)) ?/) > (substring path 0 (- (length path) 1)) > path)) > > (defun cdt-query-cmdline () > (let ((path (strip-trail cdt-dir))) > - (format "java -classpath%s\\lib\\clojure-1.2.0.jar;%s\\lib\ > \clojure-contrib-1.2.0.jar;%s\\lib\\debug- > repl-0.3.0-20091229.021828-3.jar;%s\\src clojure.main --repl" > + (format "java -classpath%s/lib/clojure-1.2.0.jar;%s/lib/clojure- > contrib-1.2.0.jar;%s/lib/debug-repl-0.3.0-20091229.021828-3.jar;%s/src > clojure.main --repl" > path path path path))) > > (defun cdt (port) > diff --git a/project.clj b/project.clj > diff --git a/src/com/georgejahad/cdt.clj b/src/com/georgejahad/cdt.clj > index d479877..d2d570f 100644 > --- a/src/com/georgejahad/cdt.clj > +++ b/src/com/georgejahad/cdt.clj > @@ -21,10 +21,11 @@ > ;; add-classpath is ugly, but handles the fact that tools.jar and > ;; sa-jdi.jar are platform dependencies that I can't easily put in a > ;; repo: > -(with-out-str (add-classpath (format "file://%s/../lib/tools.jar" > +(with-out-str (add-classpath (format "file:///%s/../lib/tools.jar" > (System/getProperty > "java.home")))) > -(with-out-str (add-classpath (format "file://%s/../lib/sa-jdi.jar" > +(with-out-str (add-classpath (format "file:///%s/../lib/sa-jdi.jar" > (System/getProperty > "java.home")))) > + > (import com.sun.jdi.Bootstrap > com.sun.jdi.request.EventRequest > com.sun.jdi.event.BreakpointEvent > @@ -90,7 +91,7 @@ > (defonce source-path (atom "")) > > (defn remove-trailing-slashes [s] > - (str/replace s "\\;" ";")) > + (str/replace s "/:" ":")) > > (defn set-source-path [path] > (reset! source-path (remove-trailing-slashes path))) > @@ -98,10 +99,10 @@ > (defn get-source [] > (let [file (.sourcePath (.location (.frame (ct) (cf)))) > paths (.split @source-path ";")] > - (if (= (first file) \\) > + (if (= (first file) \/) > file > (first (filter #(.exists (java.io.File. %)) > - (for [p paths] (str p "\\" file))))))) > + (for [p paths] (str p "/" file))))))) > > (defmacro check-unexpected-exception [& body] > `(try > @@ -325,11 +326,11 @@ > (re-pattern (str s "\\$")))) > > (defn fix-class [c] > - (str/replace c "/" ".")) > + (str/replace c "\\" ".")) > > (defn get-class* [fname] > (->> (.split @source-path ";") > - (map #(re-find (re-pattern (str % "\\(.*)(.clj|.java)")) > fname)) > + (map #(re-find (re-pattern (str % "/(.*)(.clj|.java)")) > fname)) > (remove nil?) > first > second > @@ -426,7 +427,7 @@ > (defn get-file-name [frame] > (let [sp (try (.sourcePath (.location frame)) > (catch Exception e "source not found"))] > - (last (.split sp "\\")))) > + (last (.split sp "/")))) > > (defn clojure-frame? [frame fields] > (let [names (map #(.name %) fields)] > > On Oct 11, 6:48 pm, atreyu <atreyu....@gmail.com> wrote: > > > Hi folks and congrats to George Jahad for this great work. > > Hoewer the cdt dont work on my windows vista. After some changes on my > > own i get the same error of Greg Willams: > > > java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap (cdt.clj:28) > > > i've tried add-classpath of tool.jar (where is the class in my jdk) > > with various formats, > > after testing the urls in browser with success but i get the > > ClassNotFound all the time > > > Current directory is c:/Users/atreyu/AppData/Roaming/.emacs.d/ > > Clojure 1.2.0 > > user=> java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap > > (cdt.clj:28) > > user=> java.lang.Exception: Unable to resolve symbol: set-source-path > > in this context (NO_SOURCE_FILE:2) > > user=> java.lang.Exception: Unable to resolve symbol: cdt-attach in > > this context (NO_SOURCE_FILE:3) > > user=> (def file-url (format "file://%s/../lib/tools.jar" > > (System/getProperty > > "java.home"))) > > #'user/file-url > > user=> file-url > > "file://c:\\Program Files\\Java\\jdk1.6.0_21\\jre/../lib/tools.jar" > > user=> (def file-path "c:\\Program Files\\Java\\jdk1.6.0_21\\jre/../ > > lib/tools.jar") > > #'user/file-url > > user=> (.exists (java.io.File. file-path)) > > true > > user=> (add-classpath file-url) > > WARNING: add-classpath is deprecated > > nil > > user=> (import com.sun.jdi.Bootstrap) > > java.lang.ClassNotFoundException: com.sun.jdi.Bootstrap > > (NO_SOURCE_FILE:15) > > > i hope somebody'll can help this poor win users ;-) -- 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