• Login
Community
  • Login

JNI in CPP plugin

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
11 Posts 3 Posters 825 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N
    Narfi Forshaken
    last edited by Oct 30, 2019, 8:43 PM

    Has anyone tried to create a jvm using jni in a cpp plugin?
    I am trying to create a plugin that call java functions.
    During initialization of plugin, the createJavaVM call hangs and there seems to be no further process.
    Has anyone done this before and give some advice on this?

    1 Reply Last reply Reply Quote 1
    • N
      Narfi Forshaken
      last edited by Nov 5, 2019, 1:19 PM

      I created a exe which calls the createJavaVM from the dll. This works.
      I created a new dll with the same code and called the function.
      Is there any difference how a plugin dll is loaded in npp?

      I use Visual Studio 2010 Professional and Visual Studio 2015 Community Edition. Tried creating plugin dll in both, and the issue in creating jvm exists.

      R 1 Reply Last reply Nov 5, 2019, 2:19 PM Reply Quote 0
      • R
        rinku singh
        last edited by rinku singh Nov 5, 2019, 1:41 PM Nov 5, 2019, 1:39 PM

        issue can be resolved by accept a pull request a repository should be here

        issue :- https://github.com/larryb82/npp-regexhelper/issues/2
        pull request ;- https://github.com/larryb82/npp-regexhelper/pull/3

        1 Reply Last reply Reply Quote 1
        • R
          rinku singh
          last edited by Nov 5, 2019, 2:10 PM

          @Narfi-Forshaken said in JNI in CPP plugin:

          Is there any difference how a plugin dll is loaded in npp?
          I use Visual Studio 2010 Professional and Visual Studio 2015 Community Edition. Tried creating plugin dll in both, and the issue in creating jvm exists.

          .net framework 4.0 should be installed for c# plugin API(x64 build)
          for c++ plugin API use latest Plugin Template

          N 1 Reply Last reply Nov 7, 2019, 3:39 PM Reply Quote 1
          • R
            rinku singh @Narfi Forshaken
            last edited by Nov 5, 2019, 2:19 PM

            @Narfi-Forshaken said in JNI in CPP plugin:

            I created a exe which calls the createJavaVM from the dll. This works.
            I created a new dll with the same code and called the function.
            Is there any difference how a plugin dll is loaded in npp?

            see both im.dll and im.exe project for npp and windows https://github.com/viper3400/RegExTractor

            im.dll for npp plugin hows it works
            https://github.com/viper3400/RegExTractor

            R 1 Reply Last reply Nov 5, 2019, 8:09 PM Reply Quote 1
            • R
              rinku singh @rinku singh
              last edited by Nov 5, 2019, 8:09 PM

              @gurikbal-singh said in JNI in CPP plugin:

              im.dll for npp plugin hows it works
              https://github.com/viper3400/RegExTractor

              https://github.com/viper3400/NppRegExTractor

              1 Reply Last reply Reply Quote 0
              • L
                linpengcheng
                last edited by Nov 7, 2019, 1:44 PM

                • if
                  • Write a script using clojure (a lisp dialect) on jvm.
                  • Write a script using clojure-clr (a lisp dialect) on .net.
                • and
                  • JVM and .net have a very strong ecology
                  • Clojure is better than elisp
                  • Notepad++ is better than emacs
                • Then
                  • Notepad++ will become emacs#
                EMACS --> Notepad++
                elisp --> Clojure / Clojure-CLR
                
                N 2 Replies Last reply Nov 7, 2019, 4:14 PM Reply Quote 0
                • N
                  Narfi Forshaken @rinku singh
                  last edited by Nov 7, 2019, 3:39 PM

                  @gurikbal-singh I am already using the latest plugin for development, the one provided in the link. I also have the .rc file as stated by the issue you linked above.

                  1 Reply Last reply Reply Quote 0
                  • N
                    Narfi Forshaken @linpengcheng
                    last edited by Nov 7, 2019, 4:14 PM

                    @linpengcheng I will try this and update

                    1 Reply Last reply Reply Quote 1
                    • N
                      Narfi Forshaken @linpengcheng
                      last edited by Nov 12, 2019, 5:55 PM

                      @linpengcheng While trying using Clojure, I moved the CreateJVM function from pluginInit function to plugin menu item.
                      This creates a JVM without any issue.

                      L 1 Reply Last reply Nov 13, 2019, 11:46 AM Reply Quote 1
                      • L
                        linpengcheng @Narfi Forshaken
                        last edited by Nov 13, 2019, 11:46 AM

                        @Narfi-Forshaken You can refer to the following project on github :

                        JsFormatterJavaNppPlugin

                        A JavaScript formatter and a JSON parser implemented in Java

                        1 Reply Last reply Reply Quote 0
                        8 out of 11
                        • First post
                          8/11
                          Last post
                        The Community of users of the Notepad++ text editor.
                        Powered by NodeBB | Contributors