• Post Reply Bookmark Topic Watch Topic
  • New Topic

Compiler class  RSS feed

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me the use of Compiler class with a example

Thanks in advance

Rick
 
Rancher
Posts: 42975
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That class is used by the JVM (it compiles bytecode to native code if a JIT is present), so there is no example one could give for client code that uses it.

If you are trying to compile Java source code at runtime, your code could use the classes that make up the javac compiler. That approach is described here.
 
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or stick your neck out and use Java 6 (pre-release) which has a new javax.tools package which includes compiling.
 
Rick Charles
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guyz!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!