How to know how much time taken by jvm to compile the application
8 1920
How to know how much time taken by jvm to compile the application
The JVM does not compile the application. javac does. The JVM runs the .class files.
The JVM does not compile the application. javac does. The JVM runs the .class files.
But Javac itself is entirely written in Java and is run by the JVM as well. As of
Java 1.6 there's a nice interface available to the user, i.e. you can programmatically
start the Javac compiler and time its performance if you like.
kind regards,
Jos
But Javac itself is entirely written in Java and is run by the JVM as well. As of
Java 1.6 there's a nice interface available to the user, i.e. you can programmatically
start the Javac compiler and time its performance if you like.
kind regards,
Jos
That will be the JavaCompilerTool interface?
Yep, it's quite nice.
That will be the JavaCompilerTool interface?
Yep, it's quite nice.
I haven't tried it yet but can we instantiate a compiler object when just the JRE
is installed on some machine? I guess not but can't prove it.
It would be nice to have a 'scriptable' Java, i.e. compile from a String or Stream
to a byte[] array and use that for class loading ... it would make BeanShell
superfluous ;-)
kind regards,
Jos
I haven't tried it yet but can we instantiate a compiler object when just the JRE
is installed on some machine? I guess not but can't prove it.
It would be nice to have a 'scriptable' Java, i.e. compile from a String or Stream
to a byte[] array and use that for class loading ... it would make BeanShell
superfluous ;-)
kind regards,
Jos
I imagine - JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
would return null if only there is no javac tool installed.
I imagine - JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();
would return null if only there is no javac tool installed.
This is cute; the following prints "null" on my system; (a JDK 1.6 is installed). -
System.out.println(ToolProvider.getSystemJavaCompiler());
-
kind regards,
Jos
This is cute; the following prints "null" on my system; (a JDK 1.6 is installed). -
System.out.println(ToolProvider.getSystemJavaCompiler());
-
kind regards,
Jos
I found it - com.sun.tools.javac.api.JavacTool@1ffb8dc
was the output.
I've just been looking at the code for the ToolProvider class. It seems to be checking the System java.home property. I have my Java home pointing to my JDK 1.5_3 but I used NB which I setup to run with 1.6 to run that command.
I wonder which javac it found. The 1.6 or the 1.5 that I use with Eclipse which is also set as my Java home.
I found it - com.sun.tools.javac.api.JavacTool@1ffb8dc
was the output.
I've just been looking at the code for the ToolProvider class. It seems to be checking the System java.home property. I have my Java home pointing to my JDK 1.5_3 but I used NB which I setup to run with 1.6 to run that command.
I wonder which javac it found. The 1.6 or the 1.5 that I use with Eclipse which is also set as my Java home.
I just peeked at the sources of the ToolProvider class too: you're right: it checks
the java_home variable; it it points at the jre it assumes that the jdk is next to it.
Finally it attempts to find the tools.jar where the compiler can be found.
I didn't have any java_home value set, hence the "null" being returned. I find it a bit
of a clumsy mechanism but I'm sure Sun uses a fancy and expensive name for it ;-)
kind regards,
Jos
Sign in to post your reply or Sign up for a free account.
Similar topics
by: pekka niiranen |
last post by:
Hi there,
I have perl script that uses dynamically
constructed regular in this way:
------perl code starts ----
$result "";
$key = AAA\?01;
$key = quotemeta $key;
$line = " ...
|
by: Code4u |
last post by:
I need to design data storage classes and operators for an image
processing system that must support a range of basic data types of
different lengths i.e. float, int, char, double. I have a...
|
by: baustin75 |
last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie
only when debugging in php designer 2005
--------------------------------------------------------------------------------
...
|
by: LongBow |
last post by:
Hello all,
From doing a google serach in the newsgroups I found out that a
string can't be returned from a function, but using a char* I should
be able to do it. I have spent most of the day...
|
by: Jax |
last post by:
I have Visual Studio 2002 Standard Edition.
It has been working fine up to a point and now i'm at that
point.
Due to the limitations of the edition i am not using any
of my own .dll's and instead...
|
by: Chronologic |
last post by:
All,
I have an issue I would like some expert help on.
I understand, or so I believe, that C# does not support the concept of
a "compile time macro". At least not in the sense I'm looking...
|
by: Niklas Norrthon |
last post by:
I've been banging my head in the wall for some time now over a
little problem having to do with partial specialization of
function templates.
The real problem is more complex than this, but...
|
by: Rahul |
last post by:
Hi Everybody
I have some problem in my script. please help me. This is script file.
I have one *.inq file. I want run this script in XML files. But this
script errors shows . If u want i am...
|
by: cwoll |
last post by:
Hi
I need help. I have a ms access 2003 database that I would like to
upgrade to ms access 2007. The first time I opened I had to fix a few
references it wanted a DAO2535.TLB file witch I gave it,...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |