This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes customize the entry point of program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "customize the entry point of program" Watch "customize the entry point of program" New topic
Author

customize the entry point of program

pradeepta chopra
Ranch Hand

Joined: Jul 05, 2008
Posts: 137
hi
cant we customize the entry point of our program??
like we have main as the entry point for execution of our program.is there any way we can make some other method as the entry point of execution of our program??
Rajkamal Pillai
Ranch Hand

Joined: Mar 02, 2005
Posts: 443
    
    1

Hi,

Do keep in mind that you are talking about programs executed from the command line. Other for example servlets or applets have different entry points.

Cheers,
Raj.
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
Pradeep,
I am curious..

What are you trying to do?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
Originally posted by pradeepta chopra:
hi
cant we customize the entry point of our program??
like we have main as the entry point for execution of our program.is there any way we can make some other method as the entry point of execution of our program??
Apart from things like applets, which usually use init() and servlets, both as mentioned earlier, no. The JVM specifically looks for the main method with a particular signature, and will throw an Exception if it isn't found.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3432
    
  12
You could write your own custom JVM launcher.


Joanne
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
Originally posted by Joanne Neal:
You could write your own custom JVM launcher.
. . . Only if you want me to move you off beginners, Joanne.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3432
    
  12
Originally posted by Campbell Ritchie:
. . . Only if you want me to move you off beginners, Joanne.


I did think twice about posting a reply. Decided to just put the idea out there without going into too much detail.
pradeepta chopra
Ranch Hand

Joined: Jul 05, 2008
Posts: 137
ok thank you al
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38068
    
  22
Originally posted by pradeepta chopra:
ok thank you al
You're welcome
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: customize the entry point of program
 
Similar Threads
Why is main static
About JIT compiler
checked exception
what are dll/exe files?
classloader