Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

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

    General Discussion
    3
    4
    1207
    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.
    • Pierre Ruijters
      Pierre Ruijters last edited by

      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
      • PeterJones
        PeterJones last edited by PeterJones

        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
        • Vitaliy Dovgan
          Vitaliy Dovgan last edited by

          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
          • Vitaliy Dovgan
            Vitaliy Dovgan last edited by

            …and also:

            manual
            
            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors