• Login
Community
  • Login

Reading java package directory for java source using notepad/nppexec script?

Scheduled Pinned Locked Moved General Discussion
4 Posts 3 Posters 1.6k 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.
  • P
    Pierre Ruijters
    last edited by Jul 6, 2018, 9:01 AM

    Hello,

    Using nppexec I found a way to compile a java file and put it in a specific (package) directory using javac -d <destination> options. For this I have now a plugin command option in Macro menu which I called “Java Compile”. The code:

    cd $(CURRENT_DIRECTORY)
    javac -d C:\Users\ruijtpie\Documents\Java\rocbook\bin $(FILE_NAME)

    What I am still trying though is to run the compiled file with an other menu option “Java Run”. For that I need to be able to read the package name as a directory and put it in a code like:

    java <dir> <filename>

    I looked in much places to find any tutorial on either npp scripting or nppexec scripting, but there is not much that could help me.

    Thanks.

    1 Reply Last reply Reply Quote 0
    • P
      PeterJones
      last edited by PeterJones Jul 6, 2018, 1:40 PM Jul 6, 2018, 1:40 PM

      This is my NppExec java-run script:

      NPP_SAVE
      cd "$(CURRENT_DIRECTORY)"
      "C:\Program Files (x86)\Java\jdk1.8.0_51\bin\java" -classpath "$(CURRENT_DIRECTORY)" $(NAME_PART)
      

      (I rarely code in java, but the couple times I have (while trying to do tutorials), that seemed to work for me)

      1 Reply Last reply Reply Quote 0
      • V
        Vitaliy Dovgan
        last edited by Jul 6, 2018, 2:52 PM

        When there’s a feeling of not enough help on NppExec, type the following in NppExec’s Console:

        help all
        
        1 Reply Last reply Reply Quote 1
        • V
          Vitaliy Dovgan
          last edited by Jul 6, 2018, 2:53 PM

          …and also:

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