how to deal with java programs in EditPlus

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

1_Tools Menu-ConfigureUserTools

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

2_Empty Groups and Tools Items Window

Image3: Clicking on “Add Tool” button in the Dialog box

3_click on AddTool

Image4: The Initial window on “Add Program”

4_InitialWindowOnAddProgram

Image5: Configuring “javac” for compilation – step 1

5_CompileJavaProgram-1

Image6: Configuring “javac” for compilation – step 2

5_CompileJavaProgram-2

Image7: Verifying the “javac” tool added in the “Tools” Menu

6_VerifyCompileJavaProgramInToolsMenu

2. Options to set for Execution (“java”) :

Image8: Configuring “java” for execution

7_Configure java

Image9: Verifying the “java” tool added in the “Tools” Menu

8_VerifyRunJavaProgramInToolsMenu

Image10: Compiling a Java Program

9_Compile Java Program

Image11: Running (Executing) a Java Program by giving the command line arguments

10_Run Java Program with cmd line args

Image12: Output of running the Java Program with command line arguments

11_Run Java Program with cmd line args-output

Image13: Output of running the Java Program without any command line arguments

12_Run Java Program with no cmd line args-output

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.

104 comments so far

  1. formeoct on

    Is there a way to debug the java programs step by step using breaks etc.. using EditPlus

    • anusha on

      Its vry easy to understand and implement

  2. raghs on

    @ 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.

  3. krishnaveni on

    its very good and simple to understand thanks
    raghs

  4. Aparajitha on

    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.

    • RajKumar P on

      In such case you can set under argument text box of preferences dialogue box as:
      Argument :$(FileNameNoExt) $(Prompt)
      here a white space between “$(FileNameNoExt)” and “$(Prompt)” is mandatory.

  5. Aparajitha on

    I have agin faced another problem with it how to compile a package(User defined)

  6. raghs on

    @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🙂

  7. raghs on

    @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?

  8. raghs on

    @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!

  9. Satish on

    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

  10. Nitin on

    thanks a lot..

    It was quite well explained .

    Nitin

  11. shweta on

    how to compile java code that requires certain library files for compilation

  12. DamionKutaeff on

    Hello everybody, my name is Damion, and I’m glad to join your conmunity,
    and wish to assit as far as possible.

  13. raghs on

    @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!🙂

  14. raghs on

    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.

  15. raghs on

    @Nitin,

    Welcome here. Its my pleasure and i am glad that you found this post to be useful🙂

  16. raghs on

    @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!

  17. raghs on

    @DamionKutaeff,

    Welcome here. Thanks for the offering!🙂

  18. kuldeep on

    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)

  19. raghs on

    @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?

  20. Sumit Kumar on

    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…

  21. raghs on

    @Sumit Kumar,

    Welcome here! Thanks for the compliments. I am glad that you found this post useful!🙂

  22. Suchit on

    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

  23. raghs on

    @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🙂

  24. sachin on

    @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.

  25. raafiya on

    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)

  26. raghs on

    @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.

  27. raghs on

    @sachin,

    Welcome here and thank you for the descriptions😉

  28. raafiya on

    actually am gettin the same error msg wid command prompt also….!!!!!

  29. raghs on

    @raafiya,

    kindly send a mail with screenshots with settings you have. also give some more details on your directory structure of your programs!

  30. Sanjib on

    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

  31. raghs on

    @sanjib,

    Welcome here! Thank you very much for the comments Sanjib!🙂

  32. tanvi on

    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…

  33. tanvi on

    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)

  34. raghs on

    @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?

  35. Muhammad on

    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??

  36. raghs on

    @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.

  37. sahul vetcha on

    thanks for your info…it was useful for me a lot

  38. raghs on

    @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🙂

  39. Abhinandan Sahu on

    Hey, Thanks for a detailed tutorial.
    Great work. I really appreciate it.
    Thanks again.

  40. ashika on

    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!

  41. raghu on

    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

  42. Kyle on

    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?

  43. sudheer on

    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.

  44. sudheer on

    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..

  45. raghs on

    @sudheer,

    glad you find it useful and resolved. Thanks for dropping by!

  46. sowmya on

    even tough followed the same settings am getting
    Exception in thread “main” in edit plus plz help me

  47. Emily on

    Very well done!🙂

  48. Emily on

    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

  49. Ankita on

    i am getting this error .. can anyone please help me !

    ———- Compile Java Source ———-
    Output completed (0 sec consumed) – Cannot run the application

  50. swamy on

    This is really very helpful.
    Thanks a lot!!!

  51. hrishi on

    Hi,

    I am geting below error while compiling a program. Please help me!!!

    ———- Compile java Program ———-
    Failed to run the application
    Output completed (0 sec consumed).

  52. swamy on

    Hi,
    If u r getting below error. Please specify the javac & java exe along with the respective executable path.

    For ex : C:/jdk1.5/bin/javac.exe

    ———- Compile java Program ———-
    Failed to run the application
    Output completed (0 sec consumed).

  53. harsha on

    when i am running the javafile in editplus
    it opening the cmd prompt how to overcome?

  54. Divya on

    Thank you verymuch sir

  55. Divya on

    Thank you very much sir

  56. Srinivas Davuluri on

    hi all the techies in this group……i am new to this group and i am new to java language…i am using EDITPLUS 3.0 version ..i follow the instructions as mentioned in this blog …but i am not getting any output………please help me…….

  57. raghs on

    @harsha,

    Sorry for the delayed reply. You can avoid that by checking on the “Capture output screen”.

    Try that and let me know.

  58. raghs on

    @Divya,

    Thanks for dropping by. Glad you liked it.

  59. raghs on

    @Srinivas,

    Thanks for dropping by and welcoming you to the Java world!

    what exactly you are getting? Can you let me know the error message what gets displayed so that I can try to help you further.

  60. Srinivas on

    Harsha….thanks for removing my confusion ………i am very thankful to you…keep good work

  61. Srinivas on

    harsha it is compiled but when i run the program it gives Exception in thread “main” java.lang.NoClassDefFoundError:(java prog name)
    plz help me out

  62. sai on

    thnx for this information…

  63. naren on

    installed JDK at C:\jdk1.6.0
    i set the classpath in my system
    installed editPlus
    did the same(EDITPLUS+JAVA as above)

    I found this error in my system
    ———- Compiler ———-
    javac: file not found: Test.java
    Usage: javac
    use -help for a list of possible options

    ———- JVM ———-
    java.lang.NoClassDefFoundError: Test
    Exception in thread “main”
    Output completed (0 sec consumed) – Normal Termination

    • Siva on

      Hi Naren,

      Have you given the initial directory option in the configure user group tool option.

      Regards
      Sivashankar.r

  64. shirisha on

    hi..how can we pass input to output window in edit plus software for java programs..it is not accepting the input..i mean..i’m unable to pass input from keyboard to java programs..please help me out..

    • raghs on

      @Shirisha,

      Welcome here and thanks for dropping by. Sorry for the delayed reply.

      You can pass input from your keyboard provided you had checked in an option “Prompt for Arguments” while configuring Editplus for “Java” — Running your Java programs. Please click on the Image 8 so that you can see it in the full/maximized form.

      Hope this helps!

      Good luck🙂

  65. sandhya on

    hey raghs , nice and informative blog….helped me a lot !!🙂

    • raghs on

      @Sandhya,

      Welcome here. Thanks for dropping by!

      Glad that you like the post and it was of good use. Thank you for your compliments !!🙂

  66. roshan on

    I have used your steps for compiling and running the program.but I keep getting the message that says “Output completed (0secs)- Cannot run the application”. And also I have Editplus latest version v 3.0 and it doesnt have any checkbox like “prompt for arguements”. I’m really confused and was wondering if you can have my editplus working?

  67. raghs on

    Hi Roshan,

    I also use the latest editplus. Are you really following the steps I had described earlier? Cannot run the application may be for a different cause.

    If you try following the steps exactly as what I had mentioned, I am sure you would reach the goal. Good luck and let me know if you need any further help.

  68. jagan on

    hi raghs.
    i am glad to thankful to u .bcoz of tips are helpful me.so i have another doubt . can we run java program without entering arguments?
    plz help me. i think there is way to do it. but i forgot

  69. raghs on

    @Jagan,

    Welcome here and thank you very much for your comments🙂 Glad that you liked it!

    Yes of course. we can very well run the programs without any arguments. With the same settings you can run by simply pressing an enter in the window which waits for your argument inputs.

    Just try it out. otherwise, you can alter the settings so that it does NOT ask any user input. Save the settings and run again.

    Good luck. Let me know if you face any issues.

  70. smita on

    thanks for your info…it was useful for me a lot

    I am glad that you found it useful

  71. smita on

    thanks for your info…it was useful for me a lot

    keep it going………………

  72. raghs on

    @Smita,

    Welcome here. Thanks for the comments!🙂

  73. vinu on

    tnq broth its very usefull 4 me….m new 2 this application so working on it!! nice work

  74. Tushar on

    I am able to compile the program. But when I Run it , it gives me
    ———- Run Java Program ———-
    java.lang.NoClassDefFoundError: test
    Caused by: java.lang.ClassNotFoundException: test
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    Could not find the main class: test. Program will exit.
    Exception in thread “main”
    Output completed (0 sec consumed) – Normal Termination

    This means the CLASSPATH is not set.
    Can you tell me how do you set the classpath ?

  75. Raghavendra on

    Your post helped me configure EditPlus to run Java programs. But when i run the program cmd is invoked where the output is displayed which i personally find it inconvenient. I would rather like the output to be displayed in Editplus window itself(At the bottom as shown in the tutorial). Pls help me configure..

  76. Shrey Kumar on

    @ Aparajitha on Thursday, February 14, 2008

    Hi i was just searching for my queries and i happen to read urs.

    Any ways ur solution is, after selecting the option for Argument: $(FileNameNoExt)

    give one SPACEand select another option $(Prompt) at the same place and it would prompt u for the arguments

    • Manjunath on

      Hii shrey,
      thnx for ur post , actually i was facing problem wit “promt” but after reading ur post i came to know that i have to give “a space” between $(FileNameNoExt) and $(promt)….now its working. tnk u

  77. ramz on

    while am compiling java program………..

    ———- Compile Java Program ———-
    Output completed (0 sec consumed) – Cannot run the application
    this error is displayed………

    what’s wrong?

  78. prashanth deekonda on

    HI
    my editplus is able to compile and run the java program but it is showing an error to declare the class path

    Exception in thread “main” java.lang.NoClassDefFoundError: $(file

  79. Learner on

    i finally got it..but still had one doubt..where to create directory and files…????

  80. Learner on

    got this msg..
    ———- Compile Java Source ———-
    javac: file not found: HeloWorld.java.java
    Usage: javac
    use -help for a list of possible options

    Output completed (5 sec consumed) – Normal Termination

  81. Learner on

    sorry..got this msg..
    ———- Run Java Class ———-
    java.lang.NoClassDefFoundError: HelloWorld/java
    Exception in thread “main”
    Output completed (0 sec consumed) – Normal Termination

  82. Learner on

    am not getting that arguments window to enter arguments..please help me

  83. M.sumanth on

    Hi ,While iam installing the edit plus in my win7 machine getting the message “some of the files could not be created .please close all application,Reboot windows and restart this instalation” kindly help me on this .

  84. NewVBScriptUser on

    Hi,

    I am a new user to Edit plus Ver 3.12 and I need to use it to debug some VBScripts. Could you please give me some basic pointers on how setup the config tool so I am able to debug a VB Script. Any help would be greatly appreciated

  85. sivasai on

    excellent answer, i am searching for hours how to achive it

  86. nuclear wastewater tanks on

    Hi there, I discovered your web site by way of Google whilst
    looking for a similar subject, your website got here up, it looks great.
    I have bookmarked it in my google bookmarks.
    Hello there, simply become aware of your weblog through Google, and found
    that it’s truly informative. I am gonna watch out for brussels. I’ll appreciate if you happen to continue this
    in future. Numerous people will probably be benefited from your writing.

    Cheers!

  87. industrial wastes on

    I was recommended this web site through my cousin. I’m not certain whether this submit is written through him as nobody else understand such specific about my trouble. You are wonderful! Thank you!

  88. Monte on

    Asking questions are in fact fastidious thing if you are not
    understanding anything completely, but this paragraph gives nice understanding even.

  89. flooring water damag on

    Hello There. I found your blog using msn. This is a really well written article.
    I will make sure to bookmark it and come back to read more of your useful info.

    Thanks for the post. I will definitely return.

  90. virginia water damage restoration on

    What’s up, I check your blogs like every week. Your story-telling style is awesome, keep it up!

  91. emergency water damage cleanup on

    I usually do not leave many remarks, however i did some searching and wound up here how to deal with java programs in EditPlus BlogsOfRaghs.
    And I actually do have a few questions for you if you usually do
    not mind. Could it be just me or does it look as if like some of the
    responses appear like left by brain dead visitors?😛 And, if you are writing at other social sites, I’d like to keep up with anything fresh you have to post. Would you make a list of all of your community sites like your Facebook page, twitter feed, or linkedin profile?

  92. securityclimate.org on

    Hello every one, here every one is sharing these kinds
    of knowledge, so it’s nice to read this website, and I used to pay a quick visit this website everyday.

  93. storm damage repair on

    What’s up i am kavin, its my first occasion to commenting anyplace, when i read this paragraph i thought i could also make comment due to this good piece of writing.

  94. water damage westchester on

    No matter if some one searches for his necessary thing, so he/she needs to be available that in detail, thus that thing is
    maintained over here.

  95. Ganesh Sapkal on

    Thanks for help…………….It is so easy to implement as well as to use. Again thanks a lot……………..

  96. Arun on

    hi,
    i have compiled and have an java exe file and stored in some other directory..i am getting an error saying…
    couldn’t find main class??
    what should i do..??

  97. Arun on

    please any one help me out??

  98. chandrakantk02 on

    I did everything as shown bt still problem for executing


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: