Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #7328

Re: Using sun javac to parse java source

Date 2011-08-23 19:00 -0400
From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Using sun javac to parse java source
References <66227810-c927-4197-a138-f25b54f26f7f@k8g2000yqk.googlegroups.com>
Message-ID <4e543134$0$305$14726298@news.sunsite.dk> (permalink)
Organization SunSITE.dk - Supporting Open source

Show all headers | View raw


On 8/23/2011 4:24 PM, Alex J wrote:
> I'm curious whether it is possible to use JavacParser -
> http://docjar.org/docs/api/com/sun/tools/javac/parser/JavacParser.html
> - built-in to OpenJDK to parse standalone java files (though claimed
> to be "internal use only API"). I googled but I've found no answers.

Java 1.6 and newer contains a supported callable Java compiler.

Use that.

If you only want to syntax check you will need to discard the
generated byte code in case of success, but that is easy.

The API is a bit complex many would say over engineered, but
it works fine.

Arne

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Using sun javac to parse java source Alex J <vstrength@gmail.com> - 2011-08-23 13:24 -0700
  Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 19:00 -0400
    Re: Using sun javac to parse java source Lew <lewbloch@gmail.com> - 2011-08-23 17:25 -0700
      Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-23 21:52 -0400
        Re: Using sun javac to parse java source Lew <lewbloch@gmail.com> - 2011-08-23 20:20 -0700
          Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-24 19:22 -0400
            Re: Using sun javac to parse java source Lew <lewbloch@gmail.com> - 2011-08-24 21:05 -0700
    Re: Using sun javac to parse java source Sebastian <sebastian@undisclosed.invalid> - 2011-08-24 10:51 +0200
      Re: Using sun javac to parse java source Arne Vajhøj <arne@vajhoej.dk> - 2011-08-24 19:19 -0400

csiph-web