Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8040799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:00:53+00:00 2026-06-05T04:00:53+00:00

package keylogger; public class TestKeys { private static int i = 0; private native

  • 0
package keylogger;

public class TestKeys {
private static int i = 0;
private native void setWinHook();
private native void unregisterWinHook();

public static void main(String args[]) {

    TestKeys o = new TestKeys();

    System.loadLibrary("MyHook"); // load the library that registers the hook

    Runnable r = new Runnable() {
        @Override
        public void run() {
            System.out.println("After the call to System.loadLibrary");
        }
    };
    new Thread(r,"new thread").start();  
  }
}

When i start the program,dll is loaded and does it’s work. But the statement inside the run method of new thread doesn’t get printed. Why is that ? Why doesn’t the java thread start ? The dll code doesn’t return immediately. Infact there is no way it can return.

And :

Does a new thread start when the program encounters a statement System.loadLibrary ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T04:00:54+00:00Added an answer on June 5, 2026 at 4:00 am

    Does a new thread start when the program encounters a statement System.loadLibrary ?

    Not unless the library creates one in its initialization section.

    P.S. Does the behaviour change if you join() the thread?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

package testing.project; public class PalindromeThreeDigits { public static void main(String[] args) { int value
package hw3; public class Main { public static void main(String[] args) { final int
package javaapplication8; public class Main { public static void main(String[] args) { int[] list1
package org.study.algos; public class Study { public static void main(String[] args) { A a
package GC; import java.util.Scanner; public class main { public static void main(String args[]) {
package com.test01; public class test01 { public static void main(String[] args) { System.out.println(hi); }
package pack; public class sample{ public static void main(String input[]) { NumberFormat numberFormat =
package matlab; import com.mathworks.toolbox.javabuilder.*; import com.eigenface.Eigenface; public class Test { public static void main(String[]
package com.valami; public class Ferrari { private int v = 0; private void alam()
package pkgPeople; import java.io.Serializable; import java.text.DecimalFormat; public class Person implements Serializable{ private String name;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.