aspose file tools
The moose likes Java in General and the fly likes Starting without �public static void main(String[] args) {} � Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Starting without �public static void main(String[] args) {} �" Watch "Starting without �public static void main(String[] args) {} �" New topic
Author

Starting without �public static void main(String[] args) {} �

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
public static void main(String[] args) {} is the point where program starts.But I do not want this,I want utility or loader or tool which load my java class,in that utility I specify the starting class and its method name.

Is there any way?
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3011
    
    9
java.exe is the standard Java launcher and requires the class you call to have a main method.
However, you can write your own Java launcher and call whatever method you want. Take a look at the Native Invocation tutorial for some examples of how to do this.


Joanne
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 8430

Originally posted by jacob deiter:
public static void main(String[] args) {} is the point where program starts.But I do not want this,I want utility or loader or tool which load my java class,in that utility I specify the starting class and its method name.

Is there any way?


Starting an application and loading a class are two separate things.
You can achieve the later by Class.forName();


[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Starting without �public static void main(String[] args) {} �
 
Similar Threads
can't run
how a class could be compiled with out any main method ?
How to make this Possible..Pls help
Doubt in Exceptions.....
Please Help me out...