Community
    • Login

    Run a Java program

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 2.7k Views 1 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.
    • Simon ThiesS Offline
      Simon Thies
      last edited by

      I wan´t to run an program with Notepad ++. But it keeps saying this:
      ; about to start a child process: “java Test”
      CreateProcess() failed with error code 2:
      The System can´t find the file.

      What can I do to fix that?

      1 Reply Last reply Reply Quote 0
      • PeterJonesP Online
        PeterJones
        last edited by

        On the rare occasions I run Java from Notepad++ (I think it’s been a couple years since I tried playing with Java), I use the NppExec plugin to run the script

        NPP_SAVE
        cd "$(CURRENT_DIRECTORY)"
        "C:\Program Files (x86)\Java\jdk1.8.0_51\bin\javac" $(FILE_NAME)
        "C:\Program Files (x86)\Java\jdk1.8.0_51\bin\java" -classpath "$(CURRENT_DIRECTORY)" $(NAME_PART)
        
        1 Reply Last reply Reply Quote 2
        • PeterJonesP Online
          PeterJones
          last edited by

          I realized I didn’t really complete my thought.

          You can define that script in the Plugins > NppExec > Execute dialog, and Save… it with a meaningful name (I use Java-CompileAndRun) , then use that plugin’s Advanced Options interface to add the script to the Macro menu (may require reloading Notepad++ after that). After it’s in that menu, you can use Shortcut Mapper to assign it a keyboard shortcut.

          From then on, if you have a java source code in the active editor tab, running that script through the Macro menu or through the keyboard shortcut will compile and execute the active java program.

          1 Reply Last reply Reply Quote 2
          • dominikcebulaD Offline
            dominikcebula
            last edited by

            Hello, recently I have created “Java Plugin for Notepad++” that allows you to compile and run java in Notepad++.
            You can find more information here https://github.com/dominikcebula/npp-java-plugin

            1 Reply Last reply Reply Quote 0

            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