Community
    • Login

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

    Scheduled Pinned Locked Moved General Discussion
    4 Posts 3 Posters 2.0k Views 2 Watching
    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 RuijtersP Offline
      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
      • PeterJonesP Offline
        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 DovganV Offline
          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 DovganV Offline
            Vitaliy Dovgan
            last edited by

            …and also:

            manual
            
            1 Reply Last reply Reply Quote 1

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors