Lightweight Java IDE that Maintains Indentation? - java

Whenever I am debugging a java program, I have to have the code indented! And I hate to manually indent code one by one (using Tab).
I would really like a lightweight Java IDE that automatically indents ALL your code at a push of a button.
A good example is "Ready To Program" Java IDE, but the downside to this IDE is that it is not compatible with JDK 1.5+
Are there any suggestions on such a Java IDE?

IntellJ IDEA and Eclipse come to my mind.
I wouldn't call Eclipse light weight though.

I use Notepad++ for quick indentation. It's called "Reindent C++ code" but it works just as well for Java code.
http://notepad-plus-plus.org/

You can use the Factor option in Netbeans to properly format/indent your Java code. It's even got a handy shortcut: Alt+Shift+F
Edit: Oh yeah, Netbeans is great, but not really lightweight...

In the good old days, I used to use emacs as an "IDE" for Java development. It has excellent support for code indentation and formatting.

Coding Java in NPP must be similar experience to shaving yourself with blunt stone and using vodka instead of aftershave. It may look manly, but there's no reason. It's XXI century. Intellij will run on any reasonable PC, same with NetBeans and Eclipse.
Those features are no-brainer for me, along with about hundred of others. Build in debugger with ability to execute any piece of code, or checking variable state are also necessary. I know that most of debugger may be replaced with good suite of unit tests, however sometimes you just need to check something live.
And as we are on topic of unit tests, even that is possible to simplify with good IDE. Intellij allows you to navigate between class and test class, run single test, whole class or suite with simple key stroke, generate test method from template, etc.
If you live from writing code, then don't do it to yourself and just buy a license, or use open version. Life is to short to work on NPP with plugins.
Disclaimer: Vim is okay, if you have to reconfigure something on live system in order to save a lot of $$$, c's it'll take time to deploy new version. In any other case, using advanced notepad is just stupid. Why? For same reason as coding not on decent hardware but on OLPC.

Related

Is there a way to create a FXML/Javafx desktop app without Netbeans, eclipse or scene builder?

I'm looking to get started with javafx and fxml, without downloading netbeans (as the official docs suggests: https://docs.oracle.com/javafx/2/get_started/fxml_tutorial.htm), eclipse or scenebuilder. I'm looking to use a simple text editor and terminal, similar to the way someone might create an html,css and javascript project. Is this possible, or is the only way to use fxml and javafx through netbeans or some other similar tool?
Technically speaking, in any programming language, IDE is always optional.
You can write all your source codes (.java, .css, .fxml) files using any text editor that you like (like Notepad++), then go to a command-line interface (i.e. terminal, command prompt etc) and compile them, pretty much like how you would compile a Swing application.
The advantages of doing so? Pretty much simply because you can do this without any unnecessary downloads.
The disadvantages? You have to be VERY VERY clear on every single details about Java and JavaFX.
You need to be extremely familiar with building and compiling Java applications manually. You need to do your own build path in order to compile right.
There is nothing there that will instantly tell you that you have made a mistake (be it minor or major, or even a typo). You will only see where went wrong after you re-compile via command-line.
You have to do your imports manually (in both java and fxml). This means that you would have to know the exact package names and class names.
Most of the time, you would have to imagine how your application would look like visually. The only time if you know you designed right is when you re-compile and run it via command-line.
HTML, CSS, Javascript are considered scripting language. This means that these codes do not require code compilation, and that there is a base application/process that is running in the background to interpret what you wrote in English terms (or at least it is very close to English).
Languages like Java are true programming language, they require you to compile them, and running them will most likely create a new process on the OS.
So the conclusion is, it is definitely possible to do so, but you would probably end up using 10x (if not 100x) more time doing the same thing. IDE is there to help you do some of the tedious things. If you really want to do it using the traditional command-line method, ask a new question on that.

Java IDE with VIM integration for someone coming from C/C++

I'm an experienced C/C++ programmer getting into Java and looking for a good IDE with VIM integration or a VIM plug-in that let me use the same key mappings for things like editing, cscope and omnicompletion functionality. What I mean is that whatever native functionality is provided by the IDE can be mapped to the equivalent vim key bindings. It should run on both Windows or Linux. I don't care if I have to pay for both the IDE and the plug-in as long as they meet my needs.
The most recent question I saw dealing with this type of question here on SO is over a year old and I'm sure the 'state of the art' has changed since then.
I want to hear from people with actual hands on experiance with these IDEs and VIM plug-ins.
Why not just use VIM?
You know exactly what it can do and how it can be extended, and it appears to be what you want anyway.
You will not be satisfied by any emulation as it will fall short, and with your current mindset you will not like having to learn a new editor. It is, however, what I will recommend you to do. The things modern Java IDE's can do are miles above what VIM can do because they know your source intimately. You will benefit the most from an IDE if you use its default configuration, and I do not know any which wants to look like vi/vim.
When THAT is said, you might find http://ideavim.sourceforge.net/ interesting. IDEA is the only common place Java IDE left which makes money...
There's a VI plugin for IntelliJ. I've never used it, so can't comment on its userfriendliness, but IntelliJ itself is excellent.
Recently when I've been coding Java at work I've been using vrapper It has some minor usability bugs and some missing features (such as cit) but it really seems to work well in just providing basic vi editing functionality.
Ok, it seems I misread the original question a bit by looking too much at the other answers. I don't really know how easily you can map Eclipse's native omnicompletion functionality to the corresponding vim mappings. However I think you can be very productive with the bindings provided by wrapper and by learning just a few of the most important coding assistance keys in Eclipse.
There might even be a Stackoverflow question about this but the most important shortcuts I've found are:
ctrl+space for "omnicompletion"
ctrl+1 for opening the menu of suggested quick fixes for an error or warning
shift+ctrl+t for opening a type
I've been using the viplugin for eclipse (http://www.viplugin.com/viplugin/)
It's quite good, fights a little bit with refactoring, but most of the main editing commands work. I still have to use vim for complex regex work, but I only have to do that about twice a year.
Unfortunately it's commercial (€15) and development seems to have slowed a lot. It seems to be currently more feature complete than vrapper, but I haven't tried that.
I'm also researching VIM / Eclipse integrations, and these seem most interesting:
Vrapper
Eclim
(according to this Hacker News discussion and this other SO question)
Looks like there is one for netbeans, (a stack overflow thread) Is it possible to use VI or VIM keymap in NetBeans?

For someone coming from Visual Studio/C# background and wants to learn Java - Which should I get: Netbeans or Eclipse?

I'm looking for the following:
A nice debugger that allows me to easily view variable values if I use breakpoints.
Works very nicely in Windows 7.
Has something similar to the Toolbox pane in Visual Studio.
Built in intellisense, and code completion with the TAB key.
Long term support. I mean something that will last and stay in active development for years. I don't want a pet project IDE that will stop developing in a year. I'm just learning so it'll be very dificult at first to switch IDE's.
I'm new so I don't really know which IDE provides what I need between the two. Any help?
Well, I switched from Eclipse to Visual Studio, and I use both just about every day.
I found it hard to get used to the little differences at first, but now I am proficient in both IDEs.
I can't speak to whether or not Netbeans would be easier to learn, but Eclipse shouldn't be hard at all.
Both IDEs will provide all of the features that you have listed, and you should be able to customize both of them to get them to work almost exactly like Visual Studio.
So you want to learn Java and your first question is about which IDE to learn ? I suggest you look at BlueJ which is an IDE designed for people who want to learn Java. From my, I admit limited, experience with the IDEs you mention, BlueJ is the one which gets least in one's way when trying to learn Java as opposed to learning the IDE. Once you've exhausted BlueJ's capabilities there is an easy progression to NetBeans through a plug-in but you would probably not find it too difficult to step up to Eclipse instead.
Yes, I know you want to choose between Eclipse and NetBeans but BlueJ might be of interest.
This is a common debate, and there are obviously merits on both sides (this might be better served as a community wiki page). I prefer Eclipse, but to answer your questions as well as I can briefly:
Works very nicely in Windows 7.
Both are fine.
Has something similar to the Toolbox pane in Visual Studio.
Sorry, not familiar. Neither are short on panes, though Eclipse has a richer cache of third party plugins that might give you the experience you want.
Built in intellisense, and code completion with the TAB key.
I believe both are Ctrl-Space by default. If you're working in Java in Eclipse, there's an automated pop-up after a half second delay each time you type a separator (.) character.
Long term support. I mean something that will last and stay in active development for >years. I don't want a pet project IDE that will stop developing in a year. I'm just >learning so it'll be very dificult at first to switch IDE's.
Both are very mature products. I'd imagine Eclipse's fortunes are a little more secure simply because NetBeans might experience some turbulence during the Oracle acquisition of Sun.
My only other comment is that it's always seemed to me that Netbeans had far nicer "click-and-go" project templates out of the box, while Eclipse offered richer third party library integrations and a better debugger.
Probably both will do. Personally, I'd rather use Netbeans, because it's easier to get started right-out-of-the box. Eclipse depends more on plugins.
Why not try both and see which one suits your individual tastes more?
Both are find but if you want to build GUI's, Netbeans has the edge as it has a built in GUI builder, including a toolbox of controls to use with it.
Eclipse does not have a GUI builder. The commercial Eclipse distribution, MyEclipse does have a GUI builder - it's actually the one from Netbeans.
Neither Intellij IDEA is the Cadillac of Java IDEs
Netbeans = Great out of box experiance
Eclipse = Highly customizable with plugins and (so I've heard) slightly better intellisence-like capabilities.
If possible, I'd say try both (despite the bandwidth problem). If you get basic Java Development versions, the sizes aren't that big (48 MB for NetBeans and 92 MB for Eclipse)
I personally prefer NetBean's in-built capabilities since I don't like having to install plugins to make my experience the way I want it (and not all Eclipse plugins are free) but most of my fellow java devs prefer Eclipse's simplicity and ease of use.
I think you should try Intellij Idea, it the most powerful-intuitive java IDE I've never seen (http://www.jetbrains.com/idea/index.html). The new Community Edition is free and more than enough for java developpement. As it is highly configurable you can choose 'TAB' for auto completion, but I think you can learn from existing combinations that are well design.
Regards.
Java has some really nice IDEs available and many will do what you require.
I dont know you, but I use VS with Resharper so I m very used to those shortcuts, if you do too then have a look at IntelliJ ( they have a comunity edition)
Otherwise you can get eclipse and get the IntelliJ keymap ( or try to get the default VS keymap)
Netbeans is nice too, but I had some problems with it ( ie didnt build, rancomly crashing, etc)
Also most offer Source Control integration ( in Eclipse you have many flavours of subversion for example)
I guess you ll have to play around and find what suits you
Cheers

Emacs and Java change propagation and errors notification

Emacs and Java change propagation
Hi,
I'm mostly used to code in IDE like Eclipse but I wanted to try emacs. Because I keep hearing about how much better it is than big IDE like Eclipse and Visual Studio.
So I was looking at what emacs provides for Java (with the JDEE extension) but it doesn't seem as complete as Eclipse.
One of the most important thing I look for in a Java editor is change propagation and error notification. For example if I rename a class, I want to be able to have all the declarations of this class renamed automatically. And if I delete a method, I want to be able to see all the place where this creates errors.
I didn't find those things in emacs, and this is a showstopper for me, I can't see how I could work on big projects without those features.
So my question is : those features don't exist or is it just me that haven't looked at the right place?
Emacs can be better that Eclipse, but the question is "for what"? Emacs (and VIM) are generally smaller, faster and optimized for text editing and navigation*. In recent versions Eclipse are quite capable for editing and navigating java code but with different "style".
If you are willing to learn Emacs then learn it. You will get experiences on your own and it is very important for a developer (you are the only one can decide what is work for you). But learning Emacs does not mean to "throw out" Eclipse, they can co-exist quite well if you use ant or maven-based project building and a source control system. You can for example do all editing in Emacs while for debugging and refactoring use Eclipse.
There are some interesting thought in this thread about Emacs and java development. Also there is an interesting read and conclusions about Emacs and Eclipse from someone who tried both environment.
If you are not an expert Eclipse user yet you should look at the powerful editing and navigating features of Eclipse before starting Emacs:
10 Eclipse navigation shortcuts every java programmer should know
Effective Eclipse: shortcut keys
Effective Eclipse: custom templates
Effective Eclipse: fix it quickly
Back to the question: there is an Emacs extension called Xrefactory for Java but it does not support Java 1.5 features so it is useful only if you use Java 1.4 or older.
(*) of course they are much more, I know :)
Emacs is an incredible editor, with good support for developing in C. For developing in Java there is much better support in one of the Java IDE's which has deep knowledge about the programs being edited. You probably want something like Eclipse, JDeveloper or Netbeans.
In my opinion you will not be satisified with developing Java with Emacs, and you should use another tool.
I don't know much about Emacs (so you may regard the following as off-topic), but I work with both Eclipse and VIM.
I use Eclipse for big Java projects, and I can't live without the large-scale features (cross-project renaming/refactoring etc.). I use VIM for small scale stuff (e.g. knocking up code for StackOverflow examples in multiple languages).
Eclipse and VIM have very different capabilities and consequently I use each bearing this in mind. I don't expect VIM to do the heavy lifting, but on the other hand I don't expect Eclipse to start in a keystroke and to be able to write a new (small) project in a few seconds (in whatever language I require - not restricted to Java). Perhaps you should look at the Emacs/Eclipse pair in a similar light ?

What is the best way to do Java development in Emacs?

What modes are the best?
And any tips or tricks that make developing java in emacs a bit better.
For anything else than casual Java editing, many people recommend the Java Development Environment for Emacs.
Eclim is a project that uses eclipse running in headless mode to provide features to Emacs such as in-line error checking, auto import management, basic refactoring, etc.
It's much easier than JDEE to set up and when paired with something like YASnippet I find myself more productive than I was in Eclipse. I currently have to go back for step through debugging and some project management, but I am pretty happy with it. If combined with something like JDIbug I think I would have even less reason to ever use eclipse directly.
Hope this helps
The best Java debugger for Emacs I've used is jdibug.
I have used JDEE over two years.Unfortunately,it was too old and stopped.JDEE doesn't support new features since Java 5,e.g, we can't create enum type using JDEE. And the author didn't answer any questions.I am still using Emacs+JDEE,but I can't see the future of JDEE.
Java refactoring for emacs:
http://www.xref-tech.com/xrefactory-java/main.html

Categories