Load desktop application on Windows startup [duplicate] - java

This question already has answers here:
Run Java application at Windows startup
(8 answers)
Closed 6 years ago.
I have Java desktop application, which runs fine. I can double click on exe or run jar file and runs properly.
I want to load this application whenever system starts. How can I achieve this programmatically?
Or is there any tool available to create exe in such a manner, that once we install it creates shortcut in system startup folder.
I want it be system or code driven rather than individually placing exe in startup folder.

You can set up the exe as a windows service with these steps:
open command prompt as administrator
type this:
sc.exe create <service_name> binPath= "<path to your exe> --service" DisplayName= "<somename>" start= "auto"

Related

Run a command as admin in windows from java [duplicate]

This question already has answers here:
Run command prompt as Administrator
(4 answers)
Closed 5 years ago.
I am trying to share a folder from within java using the following windows command: net share shareName=C:\folderName /grant:everyone,FULL
This command needs to be run as admin. Running it in the default cmd window gives a permissions error, but running it in cmd as admin works.
I am aware that you can run a command from within java using Runtime.getRuntime().exec("commandHere");. However, this does not execute it as admin. I've looked around, but everything either pertains to running a file as admin, or opening cmd as admin, neither of which I want to do. I just want to execute that one command.
I believe you can run the program as Admin.
either create batch file with admin privs
or launch command/powershell in admin mode and then launch java program.
I don't think windows will allow you to run program in admin mode without admin access. [of course for security reasons]
Also, I am not sure if java allows automatic elevating privileges with users permission like those allow, deny prompts with admin icon.

Running JAR file on Windows 10 [duplicate]

This question already has answers here:
How to run .jar file by double click on Windows 7 64-bit?
(18 answers)
Closed 5 years ago.
I have made a Jar file, but I cant make it to run by double clicking.
It works fine using java -jar name.jar or by making a batch file.
I have already reinstalled jdk1.8.0_102, set the JAVA_HOME variable and javaw.exe in the jre folder is already the default program to run it.
so how do I make it to run by double clicking?
How do I run an executable JAR file?
If you have a jar file called Example.jar, follow these rules:
Open a notepad.exe.
Write : java -jar Example.jar.
Save it with the extension .bat.
Copy it to the directory which has the .jar file.
Double click it to run your .jar file.

How can I run java class file using a script file in Linux at boot time? [duplicate]

This question already has answers here:
How to run a shell script at startup
(22 answers)
Closed 7 years ago.
How can I run java class file using a script file in Linux at boot time?
I have some java class file .I want that file should run at boot time when machine restart.I want to write a Script file that run those of my java classes at machine startup.
What linux distro are you using?
If you use Ubuntu then you can take a look at the upstart deamon which handles the task of starting processes during boot.
In general you create a script under /etc/init.d, described in detail here
Since i only created bash scripts there and i dont know much about Java this link might be helpful

Run eclipse project in cmd [duplicate]

This question already has answers here:
Eclipse open console apps in separate window
(4 answers)
Closed 7 years ago.
I have a console project in Eclipse.
I want to configure Eclipse to open a Windows Command Prompt window instead of its own console. The cmd window must run the project and do all input and output instead of the Eclipse console window.
This is very easy in C#.
How do I do this?
If this is a console-based application, then merely opening the executable JAR file should make it run in a Command Prompt. This can be done by typing
java -jar "<drive>:\path\to\JAR.jar"
into a CMD window. The program will now run as if it were in the Eclipse console, except in CMD. Using a batch file, you can alter the CMD with
COLOR 0A
as an example.
If you are looking for more of a user-friendly console-based application, you can get the name of the executable JAR and have it run in a ProcessBuilder inside the source code itself. This allows the JAR to open up itself in a CMD.
If I have not specified correctly, do let me know.

Remote Debugging via SSH | Netbeans [duplicate]

This question already has answers here:
Remotely debug unit tests in Netbeans / Maven
(2 answers)
Closed 6 years ago.
I'm programing on an embedded linux system calls BeagleBone Black. I'm using JDK vers. 1.6 to run my programms.
At the moment i write code on my normal pc (win7), create a .jar and transfer it via FileZilla to the Linux system (arm7). Then i connect with the embedded system using Putty (ssh tunnel) and start my programm ..."java -jar [name].jar"
Now i'm searching for a way to connect Neatbeans directly to the linux system. To bypass this laborious methode. Is there a way to debugg a programm on my pc via netbeans and it will automatically run on linux? (with console output in netbeans)?
How to configurate the ide for such a task?
Or is there alternative option?
Thanks
You can create a shared folder into the Beagle Bone via SSH an use it as a normal folder.
I am not sure about if you can do this on windows, but im sure that linux can!

Categories

Resources