Hey guys, one question for you.
I'm new in NotePad++ and I'm using Java. I was using TextPad in the past and I could compile my code file with just this Ctrl+1 and after this I could run my application with just this: Ctrl+2.
I like NotePad++ and I wanna use it but I cannot find what's going on with the compiler and the execution.
What do you think ? Can anyone help me ? Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I asked the exact same thing and I haven't got an answer yet. I'm using textpad too, but if I could somehow add "Java Compile" and "Run Java Application" that would be awesome cos Notepad had a better interface than Textpad. If SOMEONE knows please help us. ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Another post in this forum brought me onto the right path... It took quite some while anyway...
Here is the solution that works for me (WinXP)
1.
Make sure you have added the path to the javac.exe file to the environment variable
START - SETTINGS - CONTROL PANEL - SYSTEM - ADVANCED - ENVIRONMENT VARIABLES - SYSTEM VARIABLES - PATH - EDIT
=> Add (e.g.) ';D:\Program Files\Java\jdk1.6.0\bin;' at the end of the line - OK
=> You'll probably have to restart
=> Open the command prompt and type 'javac' to test it
2.
Create a new text file e.g. 'javac.bat' within your Notepad++ path e.g. 'D:\Program Files\Notepad++\javac.bat'
3.
Browse to your Notepad++ directory and edit the 'shortcuts.xml' file
e.g. 'D:\Program Files\Notepad++\shortcuts.xml'
Add the following line to the other <command> tags:
Hey guys, one question for you.
I'm new in NotePad++ and I'm using Java. I was using TextPad in the past and I could compile my code file with just this Ctrl+1 and after this I could run my application with just this: Ctrl+2.
I like NotePad++ and I wanna use it but I cannot find what's going on with the compiler and the execution.
What do you think ? Can anyone help me ? Thanks
THAT was what i looking for, big thanks ^^,
I asked the exact same thing and I haven't got an answer yet. I'm using textpad too, but if I could somehow add "Java Compile" and "Run Java Application" that would be awesome cos Notepad had a better interface than Textpad. If SOMEONE knows please help us. ;)
Another post in this forum brought me onto the right path... It took quite some while anyway...
Here is the solution that works for me (WinXP)
1.
Make sure you have added the path to the javac.exe file to the environment variable
START - SETTINGS - CONTROL PANEL - SYSTEM - ADVANCED - ENVIRONMENT VARIABLES - SYSTEM VARIABLES - PATH - EDIT
=> Add (e.g.) ';D:\Program Files\Java\jdk1.6.0\bin;' at the end of the line - OK
=> You'll probably have to restart
=> Open the command prompt and type 'javac' to test it
2.
Create a new text file e.g. 'javac.bat' within your Notepad++ path e.g. 'D:\Program Files\Notepad++\javac.bat'
Add the following two lines to it:
javac %1 2>%2\%3.output.txt
"D:\Program Files\Notepad++\notepad++.exe" "%2\%3.output.txt"
(Don't forget to adjust the path if necessary!)
3.
Browse to your Notepad++ directory and edit the 'shortcuts.xml' file
e.g. 'D:\Program Files\Notepad++\shortcuts.xml'
Add the following line to the other <command> tags:
<Command name="Run Java Compiler" Ctrl="yes" Alt="no" Shift="no" Key="112">$(NPP_DIRECTORY)\javac.bat $(FULL_CURRENT_PATH) $(CURRENT_DIRECTORY) $(NAME_PART)</Command>
That's it... Open Notepad++, open a *.java file press ctrl.-F1 and be amazed :-)
Greetings, Michel Compagnoni, Callidus GmbH
I use the following shortcuts:
to compile:
cmd /k javac "$(FULL_CURRENT_PATH)"
to execute the previously compiled code:
cmd (CURRENT_DIRECTORY) /k java "$(NAME_PART)"