Community

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

    Run a Java program

    Help wanted · · · – – – · · ·
    3
    4
    583
    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 Thies
      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
      • PeterJones
        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
        • PeterJones
          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
          • dominikcebula
            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
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors