Re: [CEDET-devel] semanticdb-javap not working
Brought to you by:
zappo
From: Joel Borggren-F. <jb...@kt...> - 2012-01-24 07:11:29
|
On Tue, Jan 24, 2012 at 2:10 AM, Eric M. Ludlam <eri...@gm...> wrote: > On 01/23/2012 01:52 PM, Joel Borggren-Franck wrote: >> >> On Mon, Jan 23, 2012 at 1:32 PM, Joel Borggren-Franck<jb...@kt...> wrote: >>> >>> On Sat, Jan 21, 2012 at 5:09 AM, Eric Ludlam<eri...@gm...> >>> wrote: >>>> >>>> On 01/19/2012 08:38 AM, Joel Borggren-Franck wrote: >>>>> >>>>> >>>>> >>>>> But I'm back at square 1,5 :/ >>>>> >>> >>>> >>>> You could find out by looking in the javap output buffer, and using M-x >>>> bovinate there to see what it is doing. I'm not Java expert enough to >>>> recognize what might be wrong from the code snippets here. The 0 tags >>>> are >>>> definitely a clue though. >>>> >>> >>> So I found this. I'll post a patch later. Explanation is that javap >>> ouputs illegal Java source code, specifically class and interface >>> names are fully qualified IE "java.lang.String" but the language only >>> accepts simple names "String" with a package declaration at the top of >>> the compilation unit. >>> >> >> Here is the patch. After this I can complete on type members in the >> jars in semanticdb-javap-classpath (on Linux, still got other issues >> on Mac :) >> >> You can try it out by setting semanticdb-javap-classpath to >> /your/path/to/rt.jar > > > Is there a way find /your/path/to/rt.jar programatically? I could use some > ubuntu packager to look it up, but I think it would be much nicer if Emacs > could auto-detect this file by default in some platform independent way. Or > maybe there are just 3 common locations to check for windows, linux, and > mac? > Yes and no. Chances are you have multiple JDKs installed, which should emacs chose? Also, there is one location on win (probably C:\Program Files\Java\...) one or more on mac (/Library/Java/JavaVirtualMachines/...) and Linux distributions probably hasn't agreed where to put it if you use the package manager (apt/yum) or you might have installed an Oracle bunde (/opt/? /usr/local/?)? So yes, it can be done, but it's a pain. But here is a list to get you started looking: - Oracle supplied bundle: JAVA_HOME/jre/lib/rt.jar - Mac OS X JDK 6: /Library/Java/JavaVirtualMachines/1.6.0_29-b11-402.jdk/Contents/Classes/classes.jar - Max OS X Oracle JDK 7 Preview: /Library/Java/JavaVirtualMachines/JDK 1.7.0 Developer Preview.jdk/Contents/Home/jre/lib/rt.jar - On Windows JAVA_HOME is usually a variation of C:\Program Files\Java ... Btw, you could possibly refine the regexp in the patch to search for and replace either "class " or "interface " as a prefix, and only use one re-search-forwad, but I couldn't figure out how emacs want's its regexp. cheers /Joel |