{"action":"created","comment":{"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments/35430253","id":35430253,"diff_hunk":"@@ -54,7 +47,44 @@ public static void main(String[] args) {\n     public VW(String command) {\n         isOpen = true;\n         lock = new ReentrantLock();\n-        nativePointer = initialize(command);\n+        // This allows the user to instead of using the prepackaged JNI layer load their own external JNI layer.\n+        // This means that if a user wants to use this code with an OS that is not supported they would follow the following steps\n+        // 1.  Download VW\n+        // 2.  Build VW for the OS they wish to support\n+        // 3.  Call either System.load(xxx) or System.loadLibrary(xxx)\n+        // After doing this then the first UnsatisfiedLinkError will never occur.  If a user wishes to use the prepackaed\n+        // JNI layer then the first time this object is constructed the UnsatisfiedLinkError will throw and the native libraries\n+        // will be loaded and every other time it will not.\n+        long currentNativePointer;\n+        try {\n+            currentNativePointer = initialize(command);","path":"java/src/main/java/vw/VW.java","position":33,"original_position":33,"commit_id":"1a8ac8b87c5c623693b649b8a67cf7bc4adab0d5","original_commit_id":"1a8ac8b87c5c623693b649b8a67cf7bc4adab0d5","user":{"login":"jmorra","id":117275,"avatar_url":"https://avatars.githubusercontent.com/u/117275?v=3","gravatar_id":"","url":"https://api.github.com/users/jmorra","html_url":"https://github.com/jmorra","followers_url":"https://api.github.com/users/jmorra/followers","following_url":"https://api.github.com/users/jmorra/following{/other_user}","gists_url":"https://api.github.com/users/jmorra/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorra/subscriptions","organizations_url":"https://api.github.com/users/jmorra/orgs","repos_url":"https://api.github.com/users/jmorra/repos","events_url":"https://api.github.com/users/jmorra/events{/privacy}","received_events_url":"https://api.github.com/users/jmorra/received_events","type":"User","site_admin":false},"body":"That is true, but if System.loadLibrary was called then the loadNativeLibrary method will never be called.  In order to make this more clear, I will set loadedNativeLibrary to true in the try block after a successful load.  Also, loadedNativeLibrary is set to true inside of the static lock so it will work correctly.","created_at":"2015-07-24T14:59:10Z","updated_at":"2015-07-24T14:59:10Z","html_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/731#discussion_r35430253","pull_request_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731","_links":{"self":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments/35430253"},"html":{"href":"https://github.com/JohnLangford/vowpal_wabbit/pull/731#discussion_r35430253"},"pull_request":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731"}}},"pull_request":{"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731","id":40375536,"html_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/731","diff_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/731.diff","patch_url":"https://github.com/JohnLangford/vowpal_wabbit/pull/731.patch","issue_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/731","number":731,"state":"open","locked":false,"title":"Adding the ability to load JNI externally","user":{"login":"jmorra","id":117275,"avatar_url":"https://avatars.githubusercontent.com/u/117275?v=3","gravatar_id":"","url":"https://api.github.com/users/jmorra","html_url":"https://github.com/jmorra","followers_url":"https://api.github.com/users/jmorra/followers","following_url":"https://api.github.com/users/jmorra/following{/other_user}","gists_url":"https://api.github.com/users/jmorra/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorra/subscriptions","organizations_url":"https://api.github.com/users/jmorra/orgs","repos_url":"https://api.github.com/users/jmorra/repos","events_url":"https://api.github.com/users/jmorra/events{/privacy}","received_events_url":"https://api.github.com/users/jmorra/received_events","type":"User","site_admin":false},"body":"The point of these changes are twofold\r\n1.  Add the ability to load the JNI library externally.  This will allow better debugging and easier hot fixes of the C code is required.\r\n2.  Expose more methods in NativeUtils to help debugging.\r\n\r\n@deaktator, I would love any feedback on this.","created_at":"2015-07-20T17:19:41Z","updated_at":"2015-07-24T14:59:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"566f282e9f2e58437256dd4e6d624dbb51812aa1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731/commits","review_comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731/comments","review_comment_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/731/comments","statuses_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/statuses/1a8ac8b87c5c623693b649b8a67cf7bc4adab0d5","head":{"label":"jmorra:master","ref":"master","sha":"1a8ac8b87c5c623693b649b8a67cf7bc4adab0d5","user":{"login":"jmorra","id":117275,"avatar_url":"https://avatars.githubusercontent.com/u/117275?v=3","gravatar_id":"","url":"https://api.github.com/users/jmorra","html_url":"https://github.com/jmorra","followers_url":"https://api.github.com/users/jmorra/followers","following_url":"https://api.github.com/users/jmorra/following{/other_user}","gists_url":"https://api.github.com/users/jmorra/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorra/subscriptions","organizations_url":"https://api.github.com/users/jmorra/orgs","repos_url":"https://api.github.com/users/jmorra/repos","events_url":"https://api.github.com/users/jmorra/events{/privacy}","received_events_url":"https://api.github.com/users/jmorra/received_events","type":"User","site_admin":false},"repo":{"id":27550397,"name":"vowpal_wabbit","full_name":"jmorra/vowpal_wabbit","owner":{"login":"jmorra","id":117275,"avatar_url":"https://avatars.githubusercontent.com/u/117275?v=3","gravatar_id":"","url":"https://api.github.com/users/jmorra","html_url":"https://github.com/jmorra","followers_url":"https://api.github.com/users/jmorra/followers","following_url":"https://api.github.com/users/jmorra/following{/other_user}","gists_url":"https://api.github.com/users/jmorra/gists{/gist_id}","starred_url":"https://api.github.com/users/jmorra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmorra/subscriptions","organizations_url":"https://api.github.com/users/jmorra/orgs","repos_url":"https://api.github.com/users/jmorra/repos","events_url":"https://api.github.com/users/jmorra/events{/privacy}","received_events_url":"https://api.github.com/users/jmorra/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jmorra/vowpal_wabbit","description":"John Langford's original release of Vowpal Wabbit -- a fast online learning algorithm","fork":true,"url":"https://api.github.com/repos/jmorra/vowpal_wabbit","forks_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/forks","keys_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/teams","hooks_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/hooks","issue_events_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/issues/events{/number}","events_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/events","assignees_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/assignees{/user}","branches_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/branches{/branch}","tags_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/tags","blobs_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/statuses/{sha}","languages_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/languages","stargazers_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/stargazers","contributors_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/contributors","subscribers_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/subscribers","subscription_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/subscription","commits_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/contents/{+path}","compare_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/merges","archive_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/downloads","issues_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/issues{/number}","pulls_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/pulls{/number}","milestones_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/milestones{/number}","notifications_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/labels{/name}","releases_url":"https://api.github.com/repos/jmorra/vowpal_wabbit/releases{/id}","created_at":"2014-12-04T16:56:47Z","updated_at":"2015-01-02T23:17:47Z","pushed_at":"2015-07-21T16:53:43Z","git_url":"git://github.com/jmorra/vowpal_wabbit.git","ssh_url":"git@github.com:jmorra/vowpal_wabbit.git","clone_url":"https://github.com/jmorra/vowpal_wabbit.git","svn_url":"https://github.com/jmorra/vowpal_wabbit","homepage":"http://hunch.net/~vw/","size":95582,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JohnLangford:master","ref":"master","sha":"62fbc5553a1cdf2f3f800cae7fdead3b00e7fd30","user":{"login":"JohnLangford","id":79590,"avatar_url":"https://avatars.githubusercontent.com/u/79590?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnLangford","html_url":"https://github.com/JohnLangford","followers_url":"https://api.github.com/users/JohnLangford/followers","following_url":"https://api.github.com/users/JohnLangford/following{/other_user}","gists_url":"https://api.github.com/users/JohnLangford/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnLangford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnLangford/subscriptions","organizations_url":"https://api.github.com/users/JohnLangford/orgs","repos_url":"https://api.github.com/users/JohnLangford/repos","events_url":"https://api.github.com/users/JohnLangford/events{/privacy}","received_events_url":"https://api.github.com/users/JohnLangford/received_events","type":"User","site_admin":false},"repo":{"id":265995,"name":"vowpal_wabbit","full_name":"JohnLangford/vowpal_wabbit","owner":{"login":"JohnLangford","id":79590,"avatar_url":"https://avatars.githubusercontent.com/u/79590?v=3","gravatar_id":"","url":"https://api.github.com/users/JohnLangford","html_url":"https://github.com/JohnLangford","followers_url":"https://api.github.com/users/JohnLangford/followers","following_url":"https://api.github.com/users/JohnLangford/following{/other_user}","gists_url":"https://api.github.com/users/JohnLangford/gists{/gist_id}","starred_url":"https://api.github.com/users/JohnLangford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JohnLangford/subscriptions","organizations_url":"https://api.github.com/users/JohnLangford/orgs","repos_url":"https://api.github.com/users/JohnLangford/repos","events_url":"https://api.github.com/users/JohnLangford/events{/privacy}","received_events_url":"https://api.github.com/users/JohnLangford/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JohnLangford/vowpal_wabbit","description":"Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.","fork":false,"url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit","forks_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/forks","keys_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/teams","hooks_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/hooks","issue_events_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/events{/number}","events_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/events","assignees_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/assignees{/user}","branches_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/branches{/branch}","tags_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/tags","blobs_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/refs{/sha}","trees_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/statuses/{sha}","languages_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/languages","stargazers_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/stargazers","contributors_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/contributors","subscribers_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/subscribers","subscription_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/subscription","commits_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/commits{/sha}","git_commits_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/git/commits{/sha}","comments_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/comments{/number}","issue_comment_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/comments{/number}","contents_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/contents/{+path}","compare_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/merges","archive_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/downloads","issues_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues{/number}","pulls_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls{/number}","milestones_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/milestones{/number}","notifications_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/labels{/name}","releases_url":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/releases{/id}","created_at":"2009-07-31T19:36:58Z","updated_at":"2015-07-23T07:40:42Z","pushed_at":"2015-07-21T19:16:00Z","git_url":"git://github.com/JohnLangford/vowpal_wabbit.git","ssh_url":"git@github.com:JohnLangford/vowpal_wabbit.git","clone_url":"https://github.com/JohnLangford/vowpal_wabbit.git","svn_url":"https://github.com/JohnLangford/vowpal_wabbit","homepage":"http://hunch.net/~vw/","size":109555,"stargazers_count":2564,"watchers_count":2564,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":727,"mirror_url":null,"open_issues_count":32,"forks":727,"open_issues":32,"watchers":2564,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731"},"html":{"href":"https://github.com/JohnLangford/vowpal_wabbit/pull/731"},"issue":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/731"},"comments":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/issues/731/comments"},"review_comments":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731/comments"},"review_comment":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/pulls/731/commits"},"statuses":{"href":"https://api.github.com/repos/JohnLangford/vowpal_wabbit/statuses/1a8ac8b87c5c623693b649b8a67cf7bc4adab0d5"}}}}