{"action":"created","issue":{"url":"https://api.github.com/repos/jni4net/jni4net/issues/48","repository_url":"https://api.github.com/repos/jni4net/jni4net","labels_url":"https://api.github.com/repos/jni4net/jni4net/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/jni4net/jni4net/issues/48/comments","events_url":"https://api.github.com/repos/jni4net/jni4net/issues/48/events","html_url":"https://github.com/jni4net/jni4net/issues/48","id":273857257,"number":48,"title":"Can't load java class.","user":{"login":"Fehrox","id":1989506,"avatar_url":"https://avatars1.githubusercontent.com/u/1989506?v=4","gravatar_id":"","url":"https://api.github.com/users/Fehrox","html_url":"https://github.com/Fehrox","followers_url":"https://api.github.com/users/Fehrox/followers","following_url":"https://api.github.com/users/Fehrox/following{/other_user}","gists_url":"https://api.github.com/users/Fehrox/gists{/gist_id}","starred_url":"https://api.github.com/users/Fehrox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fehrox/subscriptions","organizations_url":"https://api.github.com/users/Fehrox/orgs","repos_url":"https://api.github.com/users/Fehrox/repos","events_url":"https://api.github.com/users/Fehrox/events{/privacy}","received_events_url":"https://api.github.com/users/Fehrox/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-11-14T16:31:10Z","updated_at":"2018-04-16T01:55:49Z","closed_at":null,"author_association":"NONE","body":"Following the instructions from the wiki, everything works until the code is run.\r\n\r\nHere's the Java:\r\n```\r\n    package robotbridge;\r\n    import java.awt.AWTException;\r\n    import java.awt.Robot;\r\n\r\n    public class RobotBridge {\r\n\t\r\n\t    Robot robot = new Robot();\r\n\t\r\n\t    public RobotBridge() throws AWTException {}\r\n\t\r\n\t    public void MoveMouse(int x, int z) {\r\n\t    \trobot.mouseMove(x, z);\r\n\t    }\r\n\t\r\n\t    public void Click() {\r\n\t    \trobot.mousePress(0);\r\n\t    }\r\n\t\r\n    }\r\n```\r\n\r\nAnd the C#:\r\n```\r\n   using net.sf.jni4net;\r\n   using robotbridge;\r\n\r\n   class JavaRobotInput {\r\n\r\n        public static void MoveMouse(int x, int y) {\r\n            var setup = new BridgeSetup();\r\n            setup.Verbose = true;\r\n            setup.AddAllJarsClassPath(\"./\");\r\n\r\n            Bridge.CreateJVM(setup);\r\n            Bridge.RegisterAssembly(typeof(RobotBridge).Assembly);\r\n\r\n            RobotBridge robotInput = new RobotBridge();\r\n            robotInput.MoveMouse(x, y);\r\n        }\r\n    }\r\n```\r\n\r\n\r\nThis results in the following C# run-time exception:\r\n\r\n> Can't load java class for robotbridge.RobotBridge from classLoader sun.misc.Launcher$AppClassLoader@387f44\r\n>    at net.sf.jni4net.utils.Registry.LoadClass(String name, ClassLoader classLoader, JNIEnv env)\r\n   at net.sf.jni4net.utils.Registry.RegisterClass(RegistryRecord record, ClassLoader classLoader, JNIEnv env)\r\n   at net.sf.jni4net.utils.Registry.BindJvm(RegistryRecord record, ClassLoader classLoader, JNIEnv env)\r\n   at net.sf.jni4net.utils.Registry.BindJvm(RegistryRecord record, JNIEnv env)\r\n   at net.sf.jni4net.utils.Registry.RegisterType(Type type, Boolean bindJVM, JNIEnv env)\r\n   at net.sf.jni4net.utils.Registry.RegisterAssembly(Assembly assembly, Boolean bindJVM)\r\n   at net.sf.jni4net.Bridge.RegisterAssembly(Assembly assembly)\r\n   at Filirs.Utilities.JavaRobotInput.MoveMouse(Int32 x, Int32 y) in JavaRobotInput.cs:line 14\r\n   at Filirs.StateMachine.Test() in StateMachine.cs:line 46\r\n   at Filirs.Program.Main(String[] args) in Program.cs:line 20\r\n\r\nI may be missing something obvious here, but if so I can't see it and I've been looking for a while. Any help is much appreciated.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jni4net/jni4net/issues/comments/381458611","html_url":"https://github.com/jni4net/jni4net/issues/48#issuecomment-381458611","issue_url":"https://api.github.com/repos/jni4net/jni4net/issues/48","id":381458611,"user":{"login":"starryfei","id":16641113,"avatar_url":"https://avatars0.githubusercontent.com/u/16641113?v=4","gravatar_id":"","url":"https://api.github.com/users/starryfei","html_url":"https://github.com/starryfei","followers_url":"https://api.github.com/users/starryfei/followers","following_url":"https://api.github.com/users/starryfei/following{/other_user}","gists_url":"https://api.github.com/users/starryfei/gists{/gist_id}","starred_url":"https://api.github.com/users/starryfei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/starryfei/subscriptions","organizations_url":"https://api.github.com/users/starryfei/orgs","repos_url":"https://api.github.com/users/starryfei/repos","events_url":"https://api.github.com/users/starryfei/events{/privacy}","received_events_url":"https://api.github.com/users/starryfei/received_events","type":"User","site_admin":false},"created_at":"2018-04-16T01:55:49Z","updated_at":"2018-04-16T01:55:49Z","author_association":"NONE","body":"@Fehrox Can you tell me your solution? Thank you"}}
{"actor":{"display_login":"starryfei"}}