On Jan 7, 8:28 pm, "Ramon Ramos" <[email protected]> wrote:
> Hi,
>
> I would like to know, why when i run a simple java program like this one:
> ---------------------------------------------------------------------------
> --------------------------------
> public class HiDude{
>
> public static void main(String [] args){
> System.out.println("!Hi dude!");
> }}
>
> ---------------------------------------------------------------------------
> ---------------------------------
> loads a lot of classes that i dont use.... the output of the "java -verbose
> HiDude" script, is on the file output.txt.
>
> ¿Is there a way to select only the clases that i use in the program?.
>
Just do not use the verbose flag when compiling the program, this flag
adds a number of classes to allow the sending through pipes of all
what happens under the hood to the terminal (or the program) running
the java program.
The way to select only the classes you want is first not to import
whole packages, but only the classes you need, then not to use -
verbose flag.
And there is also no way not to load java.lang.
When you use the verbose flag, it sends you the details of all the
classes loaded, that's why the output is so huge, but actually if you
observe the file, there are not so much classes imported.
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---