On Wed, Mar 11, 2009 at 08:44:40AM +0100, Espen Wiborg wrote:
> Gary writes:
> > I'll see if I can debug
> > into the problem in my other emacs tomorrow, but meanwhile the
> > backtrace is:
> >
> > Debugger entered--Lisp error: (error "Process bsh not running")
> >   process-send-string(#<process bsh>
> >   "jde.util.CompileServer.compile(new String[]
> >   
> > {\"/home/gary/src/learn-jdee/src/One.java\",\"-classpath\",\"/home/gary/src/learn-jdee/src;/home/gary/src/learn-jdee/src/C:\\Programme\\Java\\jre1.5.0_12\\lib\\ext\\QTJava.zip\"});\n")
> 
> > (Just quickly looking at that, it isn't something to do with the mixed
> > cygwin and Windows paths, is it? I wouldn't expect Java to understand
> > /home/gary/... for example. Have I forgotten to configure something?)
> 
> You can't expect W32 Java to understand cygwin paths, no.

Right. But actually, converting paths is as easy as:
  $ cygpath -w /home/gary/src/learn-jdee/src/One.java
  C:\cygwin\home\gary\src\learn-jdee\src\One.java
(for example)

So... In Windows the paths that are relevant at this point are
  C:\Dokumente und Einstellungen\gary>echo %CLASSPATH%
  .;C:\Programme\Java\jre1.5.0_12\lib\ext\QTJava.zip

  C:\Dokumente und Einstellungen\gary>echo %JAVA_HOME%
  C:\Programme\Develop\Java\1.5se

If I now add the following to my Cygwin .bashrc:
  # .bashrc start
  # point JAVA_HOME to the *Windows* JDK: j2sdk is a symlink to 
/cygdrive/c/Programme/Develop/Java/1.5se
  export JAVA_HOME=/usr/local/java/j2sdk
  export CLASSPATH=`cygpath -up $CLASSPATH`
  export WIN_CLASSPATH=`cygpath -wp $CLASSPATH`
  # .bashrc end
that means that within the Cygwin environment, $CLASSPATH looks like:
  $ echo $CLASSPATH
  .:/cygdrive/c/Programme/Java/jre1.5.0_12/lib/ext/QTJava.zip
(i.e. a well formed Unix/Cygwin style path), whilst
  $ echo $WIN_CLASSPATH
  .;c:\Programme\Java\jre1.5.0_12\lib\ext\QTJava.zip
(i.e. a Windows style path)

I would prefer to be able to refer to the original environment
variables, something like
  `cygpath -wp $CLASSPATH`
when customising the jde variables (it means that I would always get the
up to date $CLASSPATH content if it changed in some way). Is there any
possibility to do something like that? I suspect not.

Referring to $WIN_CLASSPATH in the jde-global-classpath means I then see
  CompileServer output:

  -classpath 
/home/gary/src/learn-jdee/src/.;c:\Programme\Java\jre1.5.0_12\lib\ext\QTJava.zip
 /home/gary/src/learn-jdee/src/One.java

in the *JDEE Compile Server* buffer. Clearly there's something still
wrong there, though. The /home/gary/src/learn-jdee/src/ seems to be a
Cygwin-style expansion of the '.' at the beginning of
$WIN_CLASSPATH. This is a good example of why the paths should be
converted at the point they are to be used, rather than when .bashrc is
interpreted!

_Alternatives_:

Would pointing jde-jdk-registry and/or $JAVA_HOME to a shell script that
does these kind of path conversions and then passes the converted inputs
to the Windows JDK work, do you think? I found
http://cygwin.com/cgi-bin/cvsweb.cgi/wrappers/java/?cvsroot=cygwin-apps
yesterday that might work, but haven't had chance to try it yet.

There is also the possibility of using gcj / gcc-java / gcc4-java
(available as Cygwin packages), I guess, but I can't find anything
anywhere about how to use them with jdee. (For example, what path
jde-jdk-registry should be set to, given the way gcj is installed.)

> You're probably better off scrapping cygwin emacs

*choke* Not a chance. Sorry. I find EmacsW32 extremely clunky and it
also doesn't fit with all the other (Cygwin) tools that I use. I might
as well use Eclipse in that situation :-( (and believe me, I *really*
hate that idea).

> Either that, or switch to Linux on the desktop.  :)

Not an option because other people use the computer, and there isn't
really space for dual booting or virtual machining.

> Your real problem is that the bsh process isn't starting.
> Try looking at the contents of the *JDEE bsh* buffer; that may give you
> some hints.

The same kind of issue, by the look of it:
  Process bsh killed
  cd /home/gary/src/learn-jdee/src/
  /usr/local/java/j2sdk/bin/java -classpath 
/usr/share/emacs/site-lisp/jde/java/lib/bsh.jar;/usr/share/emacs/site-lisp/jde/java/bsh-commands;/usr/share/emacs/site-lisp/jde/java/lib/checkstyle-all.jar;/usr/share/emacs/site-lisp/jde/java/lib/jakarta-regexp.jar;/usr/share/emacs/site-lisp/jde/java/lib/jde.jar;/usr/local/java/j2sdk/lib/tools.jar;/home/gary/src/learn-jdee/src/.;c:\Programme\Java\jre1.5.0_12\lib\ext\QTJava.zip
 bsh.Interpreter

  java.lang.NoClassDefFoundError: bsh/Interpreter
  Exception in thread "main" 
  Process bsh exited abnormally with code 1


I should say at this point that if we can find a way to deal with this
within jdee itself (and I think this would be preferable to everyone who
wanted to use jdee on Cygwin having to mess about with scripts and so
on), but it can't be integrated within the main codebase, I would
consider proposing jdee as a Cygwin package and being the maintainer for
the resulting Cygwin package, but I need some help at this point to find
the appropriate places to change things in the code, since I don't know
the codebase at all.

For example, do I understand correctly that these calls out to the Java
compiler are being done from Java code somehow? Via bsh?
CompileServer.java, maybe? Where in the code would I find the interface
between the lisp and beanshell, is that only in beanshell.el? What is the
process of execution when one executes jde-compile?

Sorry if these are basic questions, but I can't find anything on the
website that gives me an insight into which code is responsible for what
behaviour.

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
jdee-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jdee-users

Reply via email to