Emacs comint doesn't communicates withy GroovyServer on Windows #72

Closed
Peluko opened this Issue Nov 3, 2011 · 3 comments

Projects

None yet

3 participants

@Peluko

Hello.

After solving some issues on windows, here:

#49

I can get now to open java files without malabar crashes and I can start the groovy console inside emacs. But I have severe problems, and I think they are related. For example, if I start groovy shell: malabar-groovy-start, I get the shell prompt in an emacs buffer, but as soon as I type something and press enter, for example 'help', emacs hangs indefinitely and to get control of emacs again I have to kill the java process for the groovy console. I've run groovyserver class from a cmd window, and it behaves correctly, the problem is only present when is run inside emacs.

Also, for example, when I compile with malabar I got no result, only and empty compilation buffer. I think that this is related.

Any ideas?

Thanks.

@ivv-private

Actually it's a JLine library issue. Append "-Djline.terminal=jline.UnixTerminal" to "Malabar Groovy Java Options" (malabar-groovy-java-options).

@ivv-private

Also there were an issue with invalid URI encoding in Windows. I fixed it:

diff --git a/src/main/groovy/org/grumblesmurf/malabar/Classpath.groovy b/src/main/groovy/org/grumblesmurf/malabar/Classpath.groovy
index dfd3346..1dbe0e4 100644
--- a/src/main/groovy/org/grumblesmurf/malabar/Classpath.groovy
+++ b/src/main/groovy/org/grumblesmurf/malabar/Classpath.groovy
@@ -35,13 +35,13 @@ class Classpath

     Classpath() {
         System.getProperty("sun.boot.class.path").split(File.pathSeparator).each() {
-            bootUrls << "file:" + it
+            bootUrls << (new File(it)).toURI().toString()
         }

         System.getProperty("java.ext.dirs").split(File.pathSeparator).each() { dir ->
             try {
                 (dir as File).eachFileMatch(~/.*.jar/) {
-                    extUrls << "file:" + it
+                    extUrls << it.toURI().toString()
                 }
             } catch (FileNotFoundException e) {
                 // EAT IT
@@ -54,15 +54,12 @@ class Classpath
         this.artifacts = artifacts;

         this.extraEntries = extraEntries.collect {
-            if ((it as File).isDirectory() && !it.endsWith("/"))
-              it = it + "/"
-            this.urls << "file:" + it
-            "file:" + it
+            (new File(it)).toURI().toString()
         }
-        
+       
         artifacts.each {
             if (it.file)
-                this.urls << "file:" + it.file.path
+                this.urls <<  (new File(it.file.path)).toURI()
         }
     }

@@ -94,6 +91,7 @@ class Classpath

     def classcollector = { it, map ->
         URI uri = new URI(it);
+
         File file = new File(uri);
         String absolutePath = file.absolutePath
         if (file.exists()) {
@@ -163,7 +161,7 @@ class Classpath
         artifacts.each {
             currentArtifact = it
             if (it.file)
-                classcollector("file:" + it.file.path, classMap)
+                classcollector(new File(it.file.path).toURI().toString(), classMap)
         }
     }

@@ -175,7 +173,7 @@ class Classpath
     }

     def newClassLoader() {
-        def realUrls = urls.collect { new URL(it) }
+        def realUrls = urls.collect { it.toURL() }
         return new RootLoader(realUrls as URL[],
                               ClassLoader.systemClassLoader.parent)
     }
@m0smith
Owner

You can type help in both the Malabar Eval Server and Malabar Compile Server buffers.

@m0smith m0smith closed this Dec 10, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment