Windows Startup

Discussion in 'Java' started by JediKnight2, Jan 20, 2007.

  1. JediKnight2

    JediKnight2 Guest

    Why would a .jar file not startup if a key was set in
    HKLM\Software\Microsoft\Windows\CurrentVersion\Run

    The location is correct...I have even tried to convert it into an exe
    using Launch4j and it wont start using a registry key..
     
    JediKnight2, Jan 20, 2007
    #1
    1. Advertising

  2. JediKnight2

    Chris Guest

    JediKnight2 wrote:
    > Why would a .jar file not startup if a key was set in
    > HKLM\Software\Microsoft\Windows\CurrentVersion\Run
    >
    > The location is correct...I have even tried to convert it into an exe
    > using Launch4j and it wont start using a registry key..
    >


    Don't know, but Install4j, made by the same people, has an option that
    will let you start a java app as a service. Might be a better option.
     
    Chris, Jan 20, 2007
    #2
    1. Advertising

  3. JediKnight2 wrote:
    > Why would a .jar file not startup ...


    Any number of reasons. Does it work from the command line?

    Andrew T.
     
    Andrew Thompson, Jan 20, 2007
    #3
  4. JediKnight2

    JediKnight2 Guest

    Yup...starts by double clicking as well...in addition, if I throw a
    shortcut into the startup folder it starts...



    Andrew Thompson wrote:
    > JediKnight2 wrote:
    > > Why would a .jar file not startup ...

    >
    > Any number of reasons. Does it work from the command line?
    >
    > Andrew T.
     
    JediKnight2, Jan 20, 2007
    #4
  5. JediKnight2 wrote:
    > Yup...


    Please refrain from top-posting.

    >...starts by double clicking as well...in addition, if I throw a
    > shortcut into the startup folder it starts...


    OK - that rules out my immediate expertise.

    Can you enable logging on it?
    Does it *produce* any log?

    Andrew T.
     
    Andrew Thompson, Jan 20, 2007
    #5
  6. JediKnight2 wrote:
    > Why would a .jar file not startup if a key was set in
    > HKLM\Software\Microsoft\Windows\CurrentVersion\Run
    >
    > The location is correct...I have even tried to convert it into an exe
    > using Launch4j and it wont start using a registry key..
    >


    A couple things that could cause it to not work:

    1) Since Java requires a a classpath to work correctly it is possible
    that when the items listed in the registry to automatically start the
    classpath isn't set and so java errors out trying to run your jar.
    Whether this is null and void by converting it into an exe using
    Launch4j I don't know since I don't know how that works.

    2) Try specifying the full path to your java.exe and specify the data in
    the Run key by using the normal syntax for running a jar with java.exe
    (by using -jar switch):
    "c:\Program Files\java\jre1.6.0\bin\java.exe" -jar yourjar.jar


    Also look at the Application/System event logs to see if there is
    anything useful in there.
     
    Brandon McCombs, Jan 20, 2007
    #6
  7. JediKnight2

    JediKnight2 Guest

    Brandon McCombs wrote:
    > JediKnight2 wrote:
    > > Why would a .jar file not startup if a key was set in
    > > HKLM\Software\Microsoft\Windows\CurrentVersion\Run
    > >
    > > The location is correct...I have even tried to convert it into an exe
    > > using Launch4j and it wont start using a registry key..
    > >

    >
    > A couple things that could cause it to not work:
    >
    > 1) Since Java requires a a classpath to work correctly it is possible
    > that when the items listed in the registry to automatically start the
    > classpath isn't set and so java errors out trying to run your jar.
    > Whether this is null and void by converting it into an exe using
    > Launch4j I don't know since I don't know how that works.
    >
    > 2) Try specifying the full path to your java.exe and specify the data in
    > the Run key by using the normal syntax for running a jar with java.exe
    > (by using -jar switch):
    > "c:\Program Files\java\jre1.6.0\bin\java.exe" -jar yourjar.jar
    >
    >
    > Also look at the Application/System event logs to see if there is
    > anything useful in there.


    No errors in the logs...when I run the command java -jar
    "D:\Program Files\TGDTJ\tgdtj.jar" as the registry key I get the
    following error


    java -jar "D:\Program Files\TGDTJ\tgdtj.jar" Exception in thread "main"
    java.lang.UnsatisfiedLinkError: ca.beq.util.win32.reg
    istry.RegistryKey.testInitialized()V at
    ca.beq.util.win32.registry.RegistryKey.testInitialized(Native Method)
    at
    ca.beq.util.win32.registry.RegistryKey.initialize(RegistryKey.java:25
    6) at ca.beq.util.win32.registry.RootKey.<clinit>(RootKey.java:88) at
    xlinuks.RegistryEditor.hasStartUpEntry(RegistryEditor.java:48) at
    xlinuks.gui.XMenuBar.createViewMenu(XMenuBar.java:182) at
    xlinuks.gui.XMenuBar.<init>(XMenuBar.java:31) at
    xlinuks.MainClass.init(MainClass.java:84) at
    xlinuks.MainClass.main(MainClass.java:35)
     
    JediKnight2, Jan 20, 2007
    #7
  8. JediKnight2

    JediKnight2 Guest

    JediKnight2 wrote:
    > Brandon McCombs wrote:
    > > JediKnight2 wrote:
    > > > Why would a .jar file not startup if a key was set in
    > > > HKLM\Software\Microsoft\Windows\CurrentVersion\Run
    > > >
    > > > The location is correct...I have even tried to convert it into an exe
    > > > using Launch4j and it wont start using a registry key..
    > > >

    > >
    > > A couple things that could cause it to not work:
    > >
    > > 1) Since Java requires a a classpath to work correctly it is possible
    > > that when the items listed in the registry to automatically start the
    > > classpath isn't set and so java errors out trying to run your jar.
    > > Whether this is null and void by converting it into an exe using
    > > Launch4j I don't know since I don't know how that works.
    > >
    > > 2) Try specifying the full path to your java.exe and specify the data in
    > > the Run key by using the normal syntax for running a jar with java.exe
    > > (by using -jar switch):
    > > "c:\Program Files\java\jre1.6.0\bin\java.exe" -jar yourjar.jar
    > >
    > >
    > > Also look at the Application/System event logs to see if there is
    > > anything useful in there.

    >
    > No errors in the logs...when I run the command java -jar
    > "D:\Program Files\TGDTJ\tgdtj.jar" as the registry key I get the
    > following error
    >
    >
    > java -jar "D:\Program Files\TGDTJ\tgdtj.jar" Exception in thread "main"
    > java.lang.UnsatisfiedLinkError: ca.beq.util.win32.reg
    > istry.RegistryKey.testInitialized()V at
    > ca.beq.util.win32.registry.RegistryKey.testInitialized(Native Method)
    > at
    > ca.beq.util.win32.registry.RegistryKey.initialize(RegistryKey.java:25
    > 6) at ca.beq.util.win32.registry.RootKey.<clinit>(RootKey.java:88) at
    > xlinuks.RegistryEditor.hasStartUpEntry(RegistryEditor.java:48) at
    > xlinuks.gui.XMenuBar.createViewMenu(XMenuBar.java:182) at
    > xlinuks.gui.XMenuBar.<init>(XMenuBar.java:31) at
    > xlinuks.MainClass.init(MainClass.java:84) at
    > xlinuks.MainClass.main(MainClass.java:35)


    BTW I am no java programmer
     
    JediKnight2, Jan 20, 2007
    #8
  9. In article <>, JediKnight2 wrote:
    > Why would a .jar file not startup if a key was set in
    > HKLM\Software\Microsoft\Windows\CurrentVersion\Run


    What's in the key? To be safe, you might want to use

    %JAVA_HOME%\bin\javaw.exe -jar <path-to-jar>

    Just putting the path to the jar might not work.


    --
    Steve Sobol, Professional Geek ** Java/VB/VC/PHP/Perl ** Linux/*BSD/Windows
    Victorville, California PGP:0xE3AE35ED

    It's all fun and games until someone starts a bonfire in the living room.
     
    Steven J. Sobol, Jan 20, 2007
    #9
  10. JediKnight2

    jupiter Guest

    "JediKnight2" <> wrote in message
    news:...
    >
    > JediKnight2 wrote:
    >> Brandon McCombs wrote:
    >> > JediKnight2 wrote:

    >>
    >>
    >> java -jar "D:\Program Files\TGDTJ\tgdtj.jar" Exception in thread
    >> "main"
    >> java.lang.UnsatisfiedLinkError: ca.beq.util.win32.reg
    >> istry.RegistryKey.testInitialized()V


    "Thrown if the Java Virtual Machine cannot find an appropriate
    native-language definition of a method declared native. "

    Somebody declared a method as native in your code but didn't
    fulfill the contract?

    You've got a big hurtin' on your Jedi Sword right about now.
     
    jupiter, Jan 21, 2007
    #10
  11. JediKnight2

    Chris Smith Guest

    JediKnight2 <> wrote:
    > No errors in the logs...when I run the command java -jar
    > "D:\Program Files\TGDTJ\tgdtj.jar" as the registry key I get the
    > following error
    >
    >
    > java -jar "D:\Program Files\TGDTJ\tgdtj.jar" Exception in thread "main"
    > java.lang.UnsatisfiedLinkError: ca.beq.util.win32.reg
    > istry.RegistryKey.testInitialized()V at
    > ca.beq.util.win32.registry.RegistryKey.testInitialized(Native Method)
    > at


    ....

    Oh for goodness sake! If you had an error message, why didn't you say
    so to begin with? It looks like the problem is with one of two things:
    (1) there's a library somewhere that can't be found at that point in
    startup (perhaps it's on a network drive, or there's an environment
    variable that hasn't been set yet), or (2) this library from beq.ca (Bay
    Equities Incorporated?) doesn't work on system startup.

    If you're not a programmer, as you later said, then the best thing to do
    is probably to contact some kind of technical support with whoever
    gave/sold you the program.

    --
    Chris Smith
     
    Chris Smith, Jan 22, 2007
    #11
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. perlrulez
    Replies:
    0
    Views:
    357
    perlrulez
    Feb 6, 2004
  2. perlrulez
    Replies:
    2
    Views:
    445
  3. Replies:
    3
    Views:
    11,486
  4. Arjan Dikhoff
    Replies:
    2
    Views:
    500
    Miki Tebeka
    Feb 11, 2004
  5. David Lees
    Replies:
    2
    Views:
    1,004
    David Lees
    Dec 19, 2008
Loading...

Share This Page