Problem starting java program with windows

Asked

Viewed 666 times

0

Important explanations:

  • I have an application created in JAVA;
  • An "EXE" executable was created using Launch4j;
  • I have the need to run this application after windows startup.

FIRST ATTEMPT

A shortcut has been created at C:\Users\Elfab\AppData\Roaming\Microsoft\Windows\Start Menu\Programs

This option did not prove efficient with my application.

SECOND ATTEMPT

Created an entry in windows records in the keys below

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

PROBLEM

The above options were not efficient, but with other applications this method proved efficient. The program does not start and generates error log

QUESTION

  1. There are other ways to make an application start with windows?
  2. Java programs need JVM to work, can this be a JVM dependency problem? may JVM not have started before trying to open my java application?
  3. If the dependency problem exists, have some way to launch the application only after the JVM has its initialized dependencies?
  • 3

    And what would be a solution that "proves to be efficient"? What is the problem of the forms you tried?

  • @Renan sorry if it was unclear, the problem is that the application does not start and does not generate LOG errors. An efficient solution is one that can launch the application with windows.

1 answer

3


There are other ways to make an application start with windows?

The most indicated way of this in Windows is to use the Task Scheduler, it has a command line application (Schtasks.exe) which allows you to create and remove tasks, and they can be scheduled to start on startup, just your application, or installer, run the command with the arguments you need.

Java programs need JVM to work, can this be a JVM dependency problem? may JVM not have started before trying to open my java application?

Usually no, when a Java application starts it loads the JVM, you don’t need to start the JVM first. But I don’t know if there’s anything different in case I use Launch4j

If the dependency problem exists, have some way to launch the application only after the JVM has its initialized dependencies?

See previous answer, it should not be necessary to start Java before running an application.

  • I was able to use the Task Scheduler to make it work, but only manually, through java code I still could not insert new tasks in windows. But I have a temporary solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.