Can anyone recommend a light Java IDE that doesn't require you to make new projects each time you want to compile and run a program? I just want to be able to open java files and compile and run them. I have already tried Eclipse and NetBeans but both require you to make a new project each time you want to compile and run a program. Making a new project is fine for large scale projects but for small school assignments this just makes the process more tedious.
-
8making a new simple java project in Eclipse and NetBeans takes 2 steps. I can't see your point. – Bozho Jan 24 '10 at 15:36
-
Try Xcode on Mac or gedit on Linux. Notepad++ for Windows. – Tom R Jan 24 '10 at 15:37
-
I have Notepad++ but it just doesn't have many of the features found in an IDE. And Bozho, it just gets a little tedious when I have to make new projects for every little school assignment. – Andrew Jan 24 '10 at 15:40
-
It's true that Eclipse/NetBeans are "heavier" than Notepad++ or such, but they provide a huge productivity boost. Smart code completion, automatic refactoring, and background compilation will save you enormous amounts of time and effort. Don't dismiss the "heavy" IDEs too quickly! – Eli Acherkan Jan 24 '10 at 15:42
-
Have you tried BlueJ? It's quite good for learning Java with an OO emphasis. – Adam Taylor Jan 24 '10 at 18:09
-
Embrace the project paradigm... You'll be seeing a lot of it when you graduate. ;-) Seriously, you can edit any file using the navigator in Eclipse but (IIRC) it will only compile projects. Projects also let you organize external libraries. You are learning how to take good advantage of the work of your (future?) peers I hope. – Chris Nava Feb 11 '10 at 16:03
-
Duplicate: http://stackoverflow.com/questions/1182071/light-weight-java-ide – AlfaTeK Feb 19 '10 at 13:53
17 Answers
I've been doing java school assignments using Eclipse. I had one project called "Homework", and created a new package for each assignment. That worked fine for me.
Update: in addition to the practice suggested above, it seems eclipse has a subproject (still in incubation, though) called ide4edu that is specifically for educational purposes.
The Eclipse IDE for Education is a version of Eclipse streamlined specifically for use by university and college students.

- 588,226
- 146
- 1,060
- 1,140
-
4I use Eclipse for my major projects, but I do have a "sandbox" project where I can experiment with miscellaneous code snippets and such, which is basically the same thing you've done. Works nicely. – Jeff Jan 24 '10 at 16:14
-
thats exactly what I'm doing this semester. The prof has 5 projects on the syllabus, and I created a package for each of them. This really helps with iterative development& working on multiple versions of the same assignment. – Jason Jan 24 '10 at 16:16
-
Similar. I have a sandbox project, but I don't leave code in it for long. If it's good enough to reuse then I move it to another project/package. – finnw Jan 24 '10 at 19:44
In Eclipse, you can just paste code into the package explorer without a given project, and a new project is created containing a file with that code, inside a main method. If the text you paste is a full class, it will name the file according to the class name. You could also set up a single project for your stuff and paste the code or the files you want to run into that project.

- 44,988
- 7
- 85
- 112
I've used Notepad++ to do this for simple Java projects and it worked quite well. Here is a guide on how to do this.
You may also want to check out jEdit, I believe it offers similar functionality, and may be more feature-rich for Java than Notepad++ is.

- 51,193
- 8
- 108
- 113
-
I tried using jEdit and downloaded a JavaSideKick plugin for code completion but it didn't work. – Andrew Jan 24 '10 at 15:51
-
+1 for jEdit. Neat, simple, robust. Esp perfect for small school projects – Mihir Mathuria Jan 24 '10 at 19:20
It might sound geeky or "not for novices" but in order to compile and run a single file the best option(in my opinion) is a console environment.And of course you can view them from notepad++ or any editor with similar fetures(especially highlighting).

- 808
- 2
- 16
- 38
-
That's what I am currently doing for small assignments but Notepad++ doesn't have the features of a full IDE, like code completion. I use cmd to compile. I use NetBeans for larger projects. – Andrew Jan 24 '10 at 15:54
-
You're on the right track, but cmd is pretty poor as command-line interfaces go. Try one of the various Unix shell ports, or 4NT if you prefer the DOS-style syntax. – Porculus Jan 24 '10 at 16:18
-
I think this is a good approach; as well as being lightweight and fast, it will force you to understand how javac works, especially the classpath (which can be a nightmare). – Adrian Mouat Jan 24 '10 at 16:33
-
-
for me it's perfectly adapted to novices. Learn to use javac before use an IDE. – chburd Feb 11 '10 at 12:41
My school uses DrJava for the first intro to programming class. Its a lightweight IDE and allows you to create folders on the fly for your java classes.
However, my classes now require Eclipse or Netbeans, and it did take some getting used to them. In some places, Eclipse is overkill for a second-year CS student, but I do like its features & am having fun exploring the extensability with other languages.

- 11,263
- 21
- 87
- 181
How about using a editor like Vim, or Emacs and then install some plugins so that you can have basic IDE features like code completion, etc? You will need to do bit of monkeying to get the right kind of combination and comfort. But, it could well be your answer for a lightweight IDE, one that does not require you to create a project.
NetBeans can have an arbitrary number of classes with main()
methods. Create a project named school using NetBeans and create a new package for each group of related assignments. Customize the default configuration menu to make F6
run your current main()
. At the same time, develop your skill with bash
and a favorite command line editor.
Some universities (like mine) use
for Java Teaching. It basically got everything you need for your homework assignments, and it got NO code completion, which I find perfect for Java beginners ^^.

- 59,493
- 71
- 188
- 276
-
1Unless you want to train your students to hate Java, how is this an advantage? – finnw Jan 24 '10 at 19:49
-
1When I start learning a new language, i prefer using the command-line and a simple editor, because this helps me to better learn the basic commands, API's etc. ... but maybe that's just me – helpermethod Jan 24 '10 at 22:19
-
@finnw: When doing the first few CS courses I found it useful to use a very minimal editor. This allows you to really understand loops and ifs and all that fun stuff. If you don't get your hands dirty when learning the basics debugging is HARD later. – sixtyfootersdude Feb 01 '10 at 23:24
I recommend jGRASP. It's a (very) lightweight Java editor, good for the beginning programmer. You can literally paste in some code, compile and save, and your program is ready to be run.

- 3,669
- 9
- 25
- 36
What's wrong with creating project? Just create it ones and then use it for all your assignments. That will let you use any good IDE (NetBeans, Eclipse, Intellij Idea, ...) which, from other side, greately simplifies writing java code.

- 2,173
- 20
- 20
I recommend bash
. I write a lot of test programs for work (and for the likes of answering stackoverflow questions). javac MyMain.java && java MyMain
and you are done.
I have done one project and many unrelated packages, but that sucks. It also cannot cope with more complicated build cases (when dealing with, for instance, serialisation or class loaders).

- 145,806
- 30
- 211
- 305
-
I used to do that, but nowadays I use guava and JodaTime in almost all projects, even tiny ones that I spend 4 hours or less coding, and I miss the automatic completion/import of library class names that you get in Eclipse/emacs/Netbeans. – finnw Jan 24 '10 at 19:48
-
I learnt to type and to know my libraries. That sounds sarcastic, but it is true. – Tom Hawtin - tackline Jan 24 '10 at 20:17
Personally I enjoy using Emacs for editing my code than then Ant to build / compile my Java code.
Bare in mind that using a lightweight editor will generally mean loosing out on some very useful features, for example:
Auto completion. So for example in Eclipse if you start typing System.out. you can a list of options to complete the statement along with which parameters the function will require
Mistake highlighting : nice "red swiggly lines" highlighting simple mistakes
Build path management : adding external archives is trivial in eclipse less so from the command line for those with little experience
Amongst many others.
Personally I'd way up whether the "faff" of setting up a new project for a simple Java application is worth loosing those really useful features. And that usually varies per task.

- 487
- 2
- 10
You need a well defined classpath before you can just compile you classes, and that's exactly what the project setup is for.
Just create a project once and forget about it - use it for all your stuff.

- 10,171
- 9
- 55
- 72
you can use cedit. which is not exactly a IDE but you can have compiler and JVM tools attatched to it and you can do whatever you have mentioned. i mean creating a small java file compile and run.
you can that here http://mac.softpedia.com/get/Word-Processing/CEdit.shtml

- 25,776
- 50
- 140
- 201
Why don't you create one project and fill it with all the programs you ever write. There is nothing forcing you to create a new project each time. The only reason to have multiple projects is to make managing the programs easier. So if projects don't make your life easier don't create multiple projects.
BTW: I suggest IntelliJ as I believe it is better, but in this case I suggest the problem is how you work and changing IDE won't make much difference.

- 525,659
- 79
- 751
- 1,130
This sounds redundant, but the posters are right. However, you know what you can run. If you don't have the resources and you need to run a webserver, putty, etc.. notepad ++ would work (light enough). If your desktop is nice and can handle it, use Eclipse (vast adoption). Create a java project and add packages to it (as Kaleb, Frank and other suggested).

- 5
- 2
To use IDE for assignment, my approach is to create a test project and use it each time for different assignments. Because in IDE like Netbeans and Eclipse, each class file can be made executable, thus it is quite convenient acutally.
Also for assignments if you want to have more control over your code, Notepad++ is very good for writing codes. You can add in features such as Compile and Run using macros in Notepad and make shortcut key for it.
VIM and Emacs can also be good choices as my friend often talk with me about them. Well i am not quite familiar, you can try it.

- 370
- 1
- 6
- 11