LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   boot to java app (https://www.linuxquestions.org/questions/linux-newbie-8/boot-to-java-app-924534/)

WakilNow 01-18-2012 11:29 PM

boot to java app
 
hi all,
my problem i made java app and I want run this app in the first boot and when it close computer shut down

WakilNow 01-19-2012 05:06 AM

UP!!!!

chrism01 01-19-2012 05:44 PM

We'll need to know what distro & version of Linux you have.
Also, how do you invoke the program.?
Does it require access to a screen or GUI?

WakilNow 01-20-2012 03:06 AM

thank u chrism01,
i have mint 11 , and I open it by type "java Game.class", and int build in JFrame (Canvas) so it need GUI
thank u again

WakilNow 01-20-2012 09:51 AM

up!!!!

Snark1994 01-20-2012 10:11 AM

Please don't bump threads by just posting "UP!!!", it's irritating and doesn't persuade people to answer your questions.

I think it would work if you put this into your ~/.xinitrc file:

Code:

(java Game.class; sudo shutdown -h now) &
You would need to check your sudoers file allowed you to run 'sudo shutdown -h now' without a password, or provide some other way for your user to run the 'shutdown' command without needing a password.

Hope this helps,

WakilNow 01-20-2012 10:38 AM

thanks for fast reply


All times are GMT -5. The time now is 11:09 PM.