This post may help you to deal with Java Programs in the EditPlus – a famous editor for many different type of files (for example, .java, .css, .html, .sql, .txt etc).
One more similar editor is TextPad, which can directly deal with Java applications as its taking the Java Compiler by default from the installed location in the machine it is running. Thats one advantage with that.
What exactly do i mean to say “dealing with Java applications”? Does it mean typing the source code? Absolutely NOT! That does not require any special settings and you can start typing as you would with any other file. I mean to say, “Compiling” and “Running” of Java applications.
In EditPlus, we cannot direclty deal with Java Applications and they need some sort of settings to do that. Lets see them one by one.
1. Options to set for Compilation (”javac”):
Go to “Tools” Menu -> and click on “Configure User Tools…” option.
Click on the individual images to see the full-size screenshots if it does not display the image in full.
Every image has the required description and explanation for the step.
Image1: Clicking on “Configure User Tools…” Option in the “Tools” Menu
It will open a new dialog box where in you can enter your details to configure for the tools.
Image2: The Initial Groups and Tools Window dialog box
Image3: Clicking on “Add Tool” button in the Dialog box
Image4: The Initial window on “Add Program”
Image5: Configuring “javac” for compilation – step 1
Image6: Configuring “javac” for compilation – step 2
Image7: Verifying the “javac” tool added in the “Tools” Menu
2. Options to set for Execution (”java”) :
Image8: Configuring “java” for execution
Image9: Verifying the “java” tool added in the “Tools” Menu
Image10: Compiling a Java Program
Image11: Running (Executing) a Java Program by giving the command line arguments
Image12: Output of running the Java Program with command line arguments
Image13: Output of running the Java Program without any command line arguments
Hope the series of screenshots helped you configure and run a Java Program in EditPlus.
I have blogged this steps as i have seen this in one of the threads in JavaRanch. But still, i would suggest you to just proceed with Notepad and the normal Command Window if you are in the beginning stage because the ordinary plain text editor like Notepad will help you improve your language syntax by not having any support for syntax highlighting!
It would be so nice if you could please share your feedbacks and suggestions if any for the improvement of the material.













Is there a way to debug the java programs step by step using breaks etc.. using EditPlus
By: formeoct on Tuesday, September 18, 2007
at 7:10 pm
@ formeoct,
Yes there are ways. But its possible only in IDEs (Integrated Development Environment) which could get the complete Java Runtime Environment for the program and facilititate the user to debug.
Whereas the Editplus is just an enriched editor that adds a little bit of value by having syntax highlighting, ability to compile and run the programs etc.,
You may please consider using the IDEs like Netbeans, Eclipse etc for the debugging purposes.
By: raghs on Sunday, September 30, 2007
at 5:59 pm
its very good and simple to understand thanks
raghs
By: krishnaveni on Monday, February 4, 2008
at 1:53 pm
I have Editplus latest version v 3.0 and it doesnt have any checkbox like “prompt for arguements”.So how should i run my java programs which has invovle values taken from users. Please help me out.
By: Aparajitha on Thursday, February 14, 2008
at 9:32 am
I have agin faced another problem with it how to compile a package(User defined)
By: Aparajitha on Saturday, February 16, 2008
at 8:51 am
@krishnaveni,
welcome here!
//its very good and simple to understand thanks
raghs//
am glad that you found it very useful. thank you krishnaveni! pleasure is mine
By: raghs on Tuesday, February 26, 2008
at 7:14 pm
@Aparajitha,
welcome here!
//I have Editplus latest version v 3.0 and it doesnt have any checkbox like “prompt for arguements”.So how should i run my java programs which has invovle values taken from users. Please help me out//
no idea.. i used v2.12.. it should have all.. have u followed the procedures? please let me know how u r doing it?
By: raghs on Tuesday, February 26, 2008
at 7:16 pm
@Aparajitha,
//I have agin faced another problem with it how to compile a package(User defined)//
I don’t think you have to do something explicit or special. The same helps you to compile the java classes belonging to user defined packages.
Just try doing or let me know how you do it.. so that i can try to help you further!
Thanks for dropping and commenting!
By: raghs on Tuesday, February 26, 2008
at 9:06 pm
I have the similar problem as Aparajitha regarding user packages.
I’m not able to run the class which is compiled using edit plus, ‘coz it runs the class by simulating the following comand:
java mypack/MyProg –which is not valid acc to java
it should use the command in the following way:
java mypack.MyProg
By: Satish on Friday, February 29, 2008
at 10:15 am
thanks a lot..
It was quite well explained .
Nitin
By: Nitin on Tuesday, March 18, 2008
at 2:11 pm
how to compile java code that requires certain library files for compilation
By: shweta on Wednesday, March 19, 2008
at 6:09 pm
Hello everybody, my name is Damion, and I’m glad to join your conmunity,
and wish to assit as far as possible.
By: DamionKutaeff on Sunday, March 23, 2008
at 1:14 am
@Sathish and Aparajitha,
Thank you. That’s a valid point and i have not tested that basic but important feature!
After your replies, i just tried working out. But i could not achieve it directly. Instead i can do it through a work around.
I have tried in both EditPlus 2.2 and the latest version 3.3.
In EditPlus 2.2
==========
I am able to compile the classes in user defined packages without any hassles.
Only problem is when running a java program. I had given the package name in the configuration window (in your case, i had given the following:
1. “mypack.$(FileNameNoExt)” in the “Argument:” option
2. “” in the “Initial directory:” option.
It worked fine. I know this is difficult as you have to keep changing the aforesaid 2 options for every program with a different package structure.
In EditPlus 3
=========
I think it works in a very different way. I can’t even compile the classes with and without user defined packages. I have to try a bit more and shall get back to you.
Hope this may help atleast to certain extent. There is a way with a bit overhead.
Thank you guys! Glad that you found this post to be useful.
Cheers!
By: raghs on Sunday, March 23, 2008
at 6:15 pm
ouch.. in the prev reply, the option was misinterpreted as part of html tag i guess.. as i had given it inside the angle brackets..
In Editplus 2.2 configuration,
2. “The parent directory of the mypack directory” was given in the “Initial directory:” option.
For example, if you had placed the ‘mypack’ folder inside “C:\JavaPgms\Userdefined\mypack” you need to give the
“C:\JavaPgms\Userdefined” in the “Initial directory:” option.
By: raghs on Sunday, March 23, 2008
at 6:17 pm
@Nitin,
Welcome here. Its my pleasure and i am glad that you found this post to be useful
By: raghs on Sunday, March 23, 2008
at 6:18 pm
@Shweta,
Welcome here.
//how to compile java code that requires certain library files for compilation//
I guess it can very well be achieved by giving the options for “java” and “javac” commands. For example, if you need to mention the .jar files for compiling,
“javac YourPgm.java -classpath XYZ.jar” OR
“javac YourPgm.java -cp XYZ.jar”
The XYZ.jar have to be specified with its location where it is present. Try out and let me know.
Thanks for dropping by!
By: raghs on Sunday, March 23, 2008
at 6:21 pm
@DamionKutaeff,
Welcome here. Thanks for the offering!
By: raghs on Sunday, March 23, 2008
at 6:22 pm
when i compile prog it giive me error that..
error: cannot read: first.java
and aftter running program….the output
———- Run Java Program ———-
java.lang.NoClassDefFoundError: first
Exception in thread “main”
Output completed (0 sec consumed)
By: kuldeep on Monday, May 5, 2008
at 11:42 am
@kuldeep,
welcome here!
By looking at the error you get at compilation time itself it is evident that your compilation was not successful at all.
From which directory you are running your program? It does make sense and with which only the JRE searches for the .class file.
Is your class under any specific explicit package?
By: raghs on Monday, May 5, 2008
at 9:05 pm
Well Liked it what you all have discussed above.. Long back I have used Edit plus to compile and run my Java programs.. Today I was just remembering all those stuffs.. But was king of forgotten.. I saw this website and it was very helpfull… Nice Job Guys…
By: Sumit Kumar on Monday, May 26, 2008
at 1:17 pm
@Sumit Kumar,
Welcome here! Thanks for the compliments. I am glad that you found this post useful!
By: raghs on Thursday, May 29, 2008
at 2:45 pm
Good work dude!!!It was very useful and easy too
one prob
Compiles fine but on runtime it gives an error
java.lang.NoClassDefFoundError
Exception in thread “main”
Output completed (0 sec consumed)
plz help me out
By: Suchit on Monday, June 16, 2008
at 12:04 am
@Suchit,
Welcome here!
//Good work dude!!!It was very useful and easy too//
Glad that you found it useful!
//java.lang.NoClassDefFoundError
Exception in thread “main”//
How are you actually executing it? It is all with the path/folder Editplus searches for the .class file. Just check one of the previous comments where i have clearly explained the steps!!
Sorry for the delayed response!!
If you still got stuck, let me know! Good luck
By: raghs on Tuesday, July 1, 2008
at 4:45 pm
@Suchit,
you’re getting no classfound because (as Raghs mentioned), java can not find the .class file. In order to get rid of this, when configuring your user tool, in the text box called Initial Directory, ensure that you have “$(FileDir)” for both the compile and run time commands.
By: sachin on Tuesday, July 1, 2008
at 9:56 pm
hii evryone…….
thanks for maintaining such an informative blog…!
well sachin n raghs…… am facing the same problem as suchit……….
pls guys….help out………
not able to run any program……
‘coz wen am tryin to run any java program,the following is being displayed
java.lang.NoClassDefFoundError
Exception in thread “main”
Output completed (0 sec consumed)
By: raafiya on Tuesday, July 22, 2008
at 2:20 pm
@raafiya ,
Welcome here and thank you for the nice words!!
//java.lang.NoClassDefFoundError
Exception in thread “main”
Output completed (0 sec consumed)//
This basically comes when the .class file is not being able to be picked up! Can you please check your settings on running the java application? It would be great. If not, send a mail to me with the screenshot of your settings.
By: raghs on Tuesday, July 22, 2008
at 2:47 pm
@sachin,
Welcome here and thank you for the descriptions
By: raghs on Tuesday, July 22, 2008
at 2:48 pm
actually am gettin the same error msg wid command prompt also….!!!!!
By: raafiya on Tuesday, July 22, 2008
at 4:27 pm
@raafiya,
kindly send a mail with screenshots with settings you have. also give some more details on your directory structure of your programs!
By: raghs on Tuesday, July 22, 2008
at 4:51 pm
Great to start with….Thanks Raghs…
@Rafiya… as Raghs has suggested you to check your settings.. You might check this site to find out what he means….
http://labs.cms.gre.ac.uk/java/editplus.asp
By: Sanjib on Saturday, August 16, 2008
at 1:04 pm
@sanjib,
Welcome here! Thank you very much for the comments Sanjib!
By: raghs on Monday, August 18, 2008
at 11:33 am
hi
i m getting problems with classes within same package..there r 3 classes “protection”,”derived” n “samepackage” within “package1″.
“protection” is declared public,”derived” is subclass of “protection”.
problem is “samepackage” cant access “protection” althought i used object of it..
plz help…
By: tanvi on Friday, October 10, 2008
at 2:53 am
and derived also can not access “protection n i get errer….
———- Compile Java Source ———-
derived.java:2: cannot find symbol
symbol: class protection
class derived extends protection
^
derived.java:7: cannot find symbol
symbol : variable n
location: class package1.derived
System.out.println(”n=”+n);
^
derived.java:9: cannot find symbol
symbol : variable n_pub
location: class package1.derived
System.out.println(”n_pub=”+n_pub);
^
derived.java:10: cannot find symbol
symbol : variable n_pro
location: class package1.derived
System.out.println(”n_pro=”+n_pro);
^
4 errors
Output completed (0 sec consumed)
By: tanvi on Friday, October 10, 2008
at 11:21 pm
@tanvi,
welcome here.
Where exactly your .class files are getting stored? That means, which location/directory you are storing the compiled .class files of all these source files?
By: raghs on Wednesday, October 15, 2008
at 7:49 am
I have java setup with editplus but anytime i try to run code with Scanner in it, it just freezes and i have to close java from the task manager. I can run the code in other apps and it works fine. what am i doing wrong??
By: Muhammad on Wednesday, October 29, 2008
at 8:37 am
@Muhammed,
Thanks for dropping in and welcome here!
//I have java setup with editplus but anytime i try to run code with Scanner in it, it just freezes and i have to close java from the task manager.//
I presume you use Java 6.0 with Editplus. To be frank, I have NOT tried it out yet.
But I guess there is no proper leverage between the console/terminal and the client (Editplus). Just try it out by using appropriate flush() and/or close() methods.
By: raghs on Tuesday, November 4, 2008
at 12:47 pm
thanks for your info…it was useful for me a lot
By: sahul vetcha on Friday, November 21, 2008
at 4:24 pm
@sahul vetcha,
Welcome here and thanks for dropping by!
//thanks for your info…it was useful for me a lot//
I am glad that you found it useful
By: raghs on Saturday, November 22, 2008
at 2:26 pm
Hey, Thanks for a detailed tutorial.
Great work. I really appreciate it.
Thanks again.
By: Abhinandan Sahu on Monday, November 24, 2008
at 1:58 pm
This post of yours was really useful to help me compile and run java pgms in EditPlus.
Thank you so much!
It was all well explained.
Keep it up!
By: ashika on Thursday, December 25, 2008
at 1:54 pm
hi raghs,
your tips were very helpful !!!!!!!!!!!!
but i am unable to find “prompt for arguments” option in order to run the program using command line arguments where do i find it???????
please help me
thanks,
raghu
By: raghu on Saturday, December 27, 2008
at 12:14 pm
hey thanks for all the useful info…but i still have an unusual problem….unlike everybody else im getting no errors at all!!!…no matter what i do, i wont get errors…?…. can anyone tell me what the problem is?
By: Kyle on Saturday, January 3, 2009
at 8:32 am
Hi there,
I have set up the edit plus according to the steps explained above.
But it is not compiling and creating my program when I compile it.
Please kindly explain me how to set the path to store the .class files.
Because when I compile it no class is generating in the source file directory. And when I run the program its giving NoClassDefinationFound exception.
By: sudheer on Sunday, January 25, 2009
at 10:31 pm
Hey Please Ignore my previous post. Now I can compile my java programs and see their output in edit plus itself.
Thanks for your help..
By: sudheer on Sunday, January 25, 2009
at 10:35 pm
@sudheer,
glad you find it useful and resolved. Thanks for dropping by!
By: raghs on Tuesday, February 10, 2009
at 12:01 am
even tough followed the same settings am getting
Exception in thread “main” in edit plus plz help me
By: sowmya on Monday, March 2, 2009
at 9:07 pm
Very well done!
By: Emily on Wednesday, April 1, 2009
at 1:41 am
My congratulations!
The instructions are well-organised and easy-to-follow.
Do u know how to get an output window in editplus when compiling and runnig the code how it is possible to see an output in a separate window for example when we use applet code, or code which requests to enter the text and click the button etc so that we will see these buttons and all program in a separate window.
I will appreciate any help.
I am looking forward to hear from you.
Kind Regards,
Emily
By: Emily on Wednesday, April 1, 2009
at 1:47 am