I am a full time rubyist, really enjoying rails, Sinatra, etc. Currently, however, I find myself working on a Java/TomCat/JSP project.
I was hoping someone could help me find tools, articles, books, and any other resources that will make me more comfortable?
I'm aware that Java is very different from Ruby, and the communities, likewise, are very different. That being said, all of the documentation around Java (that I have found) is a mess, and discovery is very difficult in this community.
Things I'm specifically looking for:
development environment setup tips
logger, logging, colorful output, best practice, etc
library resources and documentation
easy to navigate documentation for Java SE 6
anything you have found that makes your daily life better
Thanks!
If you are joining an existing Java project then you probably want to take a look at the tools already in use and get an existing developer / co-worker to bring you up to speed with them as a first port of call.
Having said that, here are my top tips:
Get comfortable with one of the main Java IDEs. Eclipse (my personal choice), Netbeans or IntelliJ are all excellent and very powerful tools once you get to know them. The refactoring / code navigation tools are probably better than anything you are used to in the Ruby world, they will help you a lot. Java is a lot less painful with a good IDE setup.
Learn Maven - this will take some time investment but it is extremely powerful for automating your dependency management and build process. Once you get it working you will save a huge amount of time on project / build management. Maven also provides automated access to the equivalent of Ruby gems through the various public Maven repositories.
And here are some particularly useful resources:
Java tutorials - good to get an introductory feel for the core Java libraries.
Java 6 API - useful as a reference resource for all the classes and functionality available in core Java (a lot of this is also provided via the IDEs)
JSP Documentation - for the JSP / Java EE aspects
As a little side note don't forget to learn about JSTL and Expression Language.
first of all you are on the right road to discover how elegant Java EE is. since you adressed various topics i will divide my answer into different parts :
Development environment:
Without further talk i will advise you to directly go and pick your eclipse Java EE Juno (last release) version, however if you'd like to have a look at other IDEs you can either check NetBeans 7.2 (last release) or IntelliJIDEA 11.2 Ultimate (last release i know of and that I have). Basically Eclipse has tons of plugins and features and backed up by a very great, large and passionate community.
[ i personally tried NetBeans, and IntellijIDEA, but felt more comfortable with Eclipse because of its look, features, cool color theme etc]
For JSP and HTML, CSS ,JS stuff, i however recommend the great IDE of Jetbrains Webstorm it has zen coding as well as many many other things like fast auto completion and support for many frameworks.
Lastly, pick up Sublime Text 2 as a text editor for quick edits or to just check a source file, it has a very beautiful layout and support for many languages as well as tons of plugins.
Ressources and documentations :
All the Java API specifications are available for offline viewing for free in Oracle's website and come packaged with the various SDK that are available there.
The easy to navigate documentation :
Eclipse IDE makes it very easy to attach JavaDoc and Source to the different jar files that make up a JDK, that said, your learning and coding experience will be greatly increased once you've set that up.So when you type Connection for example in IDE, you can simple hold Ctrl command then right click on it and the source code of the class implementation would be opened in a different tab. yes yes it's the power of the open source world :)
Concerning tips and tricks :
I'll recommend you use //TODO comments as Eclipse has support for them and you can setup your own TODO comments in settings, also you can use TASK comments, you've Mylyn too to manage your bugs, tasks either locally or connect to your favorite bug and issue tracker through a connector since many connectors are available for such purpose. Add to this list the possibility to configure bookmarks to help you manage your source files when they become full of lines.
About Tomcat:
Well if your goal is to make Java EE applications that do not require the advanced features of the Java EE specification, then you can use the sweet Tomcat, it's easy to use and configure and a well known web container.
However if that's not the case, and you wanna specialize in Java and spend lots of time to try to understand the ins and outs of this huge specification, you are likely to need a certified Application Server that supports all Java EE components. There are lot of them available, but since you asked for advise and I am here giving my modest suggestions I would advise you to pick the GlassFish Application Server, it's Open Source, and once you install it on Eclipse IDE for example, it will be bundled with both Java EE 5 and Java EE 6 API doc. This means no time to be wasted on browsing different tools and tabs, you will have everything grouped inside your Eclipse IDE so that you are 100% on the tasks at hand.
p.s: if you've any more questions please feel free to ping me.
Any good tip or trick :
Have fun with Java, because you will be learning everyday something new :)
p.s: i didn't mention any framework, because by the time you get used to Java EE you will be in position to pick the one that suits your needs. Also forgot to mention JUnit (Testing Framework) and a great eclipse plugin EClemma for code coverage (much better than Cobertura/eCobertura and easier to use), and of course you can try Maven as the other post mentioned, or try Apache Ant as build tool.
If you're coming from a Rails background, I'd be prepared for some initial frustration. Setting up projects in an IDE can be time consuming, and generally it's going to be more painful to get things like a basic web+app server up and running using Tomcat than using Ruby.
For a REPL, I would recommend Groovy (and indeed it comes pre-installed on Intellij) but you can also use BeanShell. Grails, or groovy on rails, is probably the closest thing we have to a Rails-like environment.
As others have said, with Java, using an IDE is really best. I like Intellij IDEA, but eclipse and NetBeans are also good.
For build and dependency management, Maven is probably as close as we have to standard, although I have heard nice things about Gradle.
There are entirely too many logging frameworks in java, use whatever your project currently uses, probably log4j or SLF4J. learn how to change log levels across the board, and also at a package level.
In terms of libraries, Google's Guava makes my life better on a daily basis.
The best "tips, tricks and general best practices" book on java is Josh Bloch's Effective Java. For documentation, the Javadoc is the authoritative source. Learn to read and write good javadocs.
For Test Driven Development, jUnit is probably the most widely used library, a very popular library is mockito, which also happens to be my favorite.
Related
So here we go. I want to choose between Aptana, Eclipse, and Netbeans. I want a sort of all inclusive program as I try out these different languages to see what I want to try out. I have VS for my C/C++. So do any of these support HTML, CSS, Javascript, and Java? I think it's netbeans but I'm not sure.
Also, what is the best paid app for Javascript? Is dreamweaver any good?
Aptana, Eclipse, and Netbeans all support HTML, CSS, JavaScript and Java.
Aptana is actually Eclipse under the covers with what looks like better support for web applications.
I have used Eclipse extensively and found that it was sufficient for my Java web development work.
Recently I have switched to using IntelliJ IDEA after using their JavaScript IDE - Webstorm. IntelliJ IDEA is a full-featured IDE with great support for various languages and frameworks. Webstorm (as far as I can tell) is a cut-down version of IntelliJ IDEA specifically focused on JavaScript development.
The great thing about IntelliJ IDEA and Webstorm is their support for mixed languages. That is, if you have HTML, CSS, and Javascript all in one file, it understands it all and highlights, and formats, the code for you properly. Another great feature are the code inspections which analyse your code for errors and common mistakes - this is a great feature.
Both IntelliJ IDEA and Webstorm are paid applications, but you can try them out for free for 30 days.
I would highly recommend trying out IntelliJ IDEA and/or Webstorm.
Eclipse is a develpoers best friend. Every language leave for .NET, but it's MEANT for Java, and the others. And NEVER buy an app to develop, it becomes a crutch.
And Eclipse has a million and a half plug-ins that can become super useful... just found this LESS CSS compiler that runs on file save... epic!
Depends on what you're doing but every place I've worked for prefers Eclipse over anything else, may just be industry standard but I get along with Eclipse very well. One thing that stands out it's modularity and the ability to find a plugin for any specific technology. I have used Netbeans in the past and it's not bad - perhaps the biggest advantage, at least when I was using it, was the built-in GUI builder specific to Swing applications but I suppose it's a matter of preference in the end. I believe both have support for the technologies that you mentioned although I haven't encountered Aptana before.
Aptana is actually Eclipse, bundled directly with highlighters for CSS, HTML, JS and adds additional very handy functionality. But you just as well could use eclipse and download all the plugins via the plugin manager and you'd have the experience of pornific-java developement, as well as porntastic javascript/html/css possibilities.
I'd recommend Aptana, unless you really need Java, then I'd do the Eclipse+Plugins attempt.
There are Eclipse builds for everything and is widely used. Netbeans is more for (you guessed it) web development, but I find a lot of people find it easier to use. Eclipse confuses people when they start using it. They both do HTML, JavaScript and CSS pretty well.
One of the strongest selling points of play framework is it's development cycle, just fix the code, go back to your browse, hit reload, and go one, all without the write, compile, deploy, hassle typical of j2ee web development.
Nevertheless, for web developers coming from php, ruby or python this is hardly surprissing, moreover it's considered the natural way to develop web apps.
Moreover, many of the advantages of play, (efficient template system, resolve errors quickly, stateless, fun & productive) are taken for granted in those frameworks...
So I'd like to know what do you think are the main advatages that play framework brings to web developer coming from dynamic languages.
From my point of view these are the main advantages
it's java, so if you don't feel confortable with java, and you are not willing to learn it, that might not be an advantage. On the other hand, if you HAVE to use java, coming from php or rails you will feel right at home with play
it's static (except for templates and routes, that's about to change on the next version), so you have compiler checks and safe refactoring.
tool support: IDE support (eclipse, intellij, netbeans)
endless collection of libraries to do everything you want, well, it's just java
runs on the jvm, which has years of experience and optimizations
it's compiled, so you may expect better performance
it's really fullstack: it comes with everything you need to develop a web app, compiler, web server, in memory db server, offline documentation, integrated database manager, local and distributed cache management, fixtures, evolutions, dependency management, lots of utility libraries, unit tests, selenium tests, ide support. You need no apache or mysql setup to get up and running
it has advanced features, like asynchronous requests, web sockets, asynchronous jobs
zero development environment setup: just unzip play.zip, play new my app, play run myapp
excellent documentation
great and fast growing community
scala is firmly in it's horizon, if you come from a dynamic language you might feel more comfortable with a language like scala, even though it's static
can be deployed to any servlet container, like tomcat, but also comes with it's own lightweight server
it's got an ever growing collection of community contributed modules
it's cloud friendly, works on gae, heroku, playapps, cloudbee, dotcloud, etc... (see this question)
source code: this is one of it's main advantages, even though it's often neglected. The source code is pretty readable, understandable and not over engineered. Even without much java knowledge, it's possible to have a look at the code, understand it, and begin contributing to the project
In my particular case, coming from a php & classic asp background, play allowed me get a web application up and running while learning java at the same time. it really let me enjoy my transition from dynamic languages to java...
Play has some advantages compared to other dynamic web frameworks, but I think that if you are proficient in codeignter, rails, django, etc, and if you are not willing to benefit from java's (or scala) ecosystem, you should stick to what you know...
A similar debate has been running on Google Groups recently, but more specifically comparing Play and Ruby (on Rails). I have tried to collate some of the feedback the community has provided on this topic, rather than just give me personal view. Hopefully this will make for a more rounded answer!
statically types business logic layer (and using the new templating engine, even your views will be statically typed). This has therefore the advantage of better IDE support as well.
Can use Java as well as Scala, so you are not restricted to a single technology stack.
Play just works out of the box, but is also highly configurable, so does not force you to work in a particular method.
In memory DB. Great for new developers, who just want to get started. No need to go through setting up WAMP/LAMP server etc, just to get started. Just download play, and you are ready to go!
Its Java (or Scala)! I got hooked on Play because I used PHP begrudgingly because it was the easiest way to host a personal website, but hated that I was building software in a way that I did not feel was well structured. Play allowed me to use Java without the bulk of a J2EE application.
Play framework. Play is heavily inspired by Ruby on Rails and Django. A developer familiar with any of these frameworks will feel at home.
1) Play leverages the power of Java to build web applications,By lifting away the Java EE constraints, Play provides developers with an easy-to-develop and elegant stack aimed at productivity.
2) It focuses on developer productivity and targets RESTful architectures. Play is a perfect companion to agile software development.
3) Folder structure of the play mostly match with the Rails.
4) Play loads the code dynamically. Just fix the bug in Java file and hit reload, the change will get reflected instantly on webpage. No need to go through those sluggish rebuild / deployment / server restart.
5) No configuration: No configuration required just download, unpack and start development.
6) Error discovery is very easy, When an error occurs, play shows the error message, the file path, line number, and relevant code snippet right in the browser.
I am new to the world of Java and web programming. Never wrote a single line of javascript and my knowledge of HTML is pretty basic. Although, I am very experienced with .NET, so I guess transition to Java should not be a revolution.
Anyway, I wish to learn GWT and for that I want to work on Eclipse (I have Mac at home, so no Visual Studio).
Now, there are a dozen different download flavors of Eclipse, so my question is - which one best suits my needs?
Thanks.
P.S.
This is probably not a factor in the decision, but I will need Visual Studio keyboard bindings. I want to believe that no matter which flavor I install, I will be able to change the keyboard bindings later.
You should be fine with any version of Eclipse. Eclipse is extremely modular so it's only really a case of ensuring you have the correct plugins installed.
I'd recommend:
Start with the Eclipse IDE for Java Developers as a base install. This has everything you need for Java (i.e. the Java Development Tools, stndard editor features, source code control etc.)
Then install the GWT plugin for Eclipse
After that you should be good to go. If you find you need more plugins later, you can easily add them.
I also know both .NET and Java, and you should not have have much difficulty making the transition - it's really just a case of learning a few slightly different conventions, APIs and ways of doing things.
With regards to the keyboard bindings, I've never really changed from the default settings myself but they are completely customizable so I'm sure you can get it set up how you want. You might want to look at the answers to this question, which give you a few options (apparently you can download the full set of bindings, or install the C++ plugin which includes them).
I would probably start by installing Eclipse for Java EE developers and then the GWT plugin. It will cause less dependencies to be installed and you will get some things installed that you will probably want to start using later. But regardless of whether you are using that or the Java developer-version you should not have any major problems.
Hello good fellas i'm sure everybody is cool.I'm about to start a tutorial about jsp and jsf and the required tool is eclipse for j2ee and web tool platform.I'm a bit confused about where to find it bundled with wtp? and in which distribution is it Europa , Galileo or Ganymede ?.i know that it's here in
entreprise java because it's clearly written there but then i don't know whether it's good for me, the main idea being to add jboss-tools to in order to use jboss seam.Please correct me right away if i'm making some foolish assumptions.thanks for reading
Go for Galileo, its the latest. To me they chose names, instead of or along with versions, to make it easy to choose and remember, but apparently made it much difficult to choose.
See this, wikipedia entry, for clarification on releases.
The Eclipse downloads you mentioned are all good candidates. I use the Ganymede (3.4) version but plan to try Galileo (3.5) soon as it is finished now (thanks #Vinegar).
I have also good experience with the non-free MyEclipse and I'm sure, Netbeans and Intellij have similarly good support for J2EE along with potential JBoss/Seam support.
You could test your installment by creating a JSP and check if you get syntax highlight for HTML and java snipplets.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I've been using Xcode for the usual C/C++/ObjC development. I'm wondering what are practical considerations, opinions of Xcode, Eclipse or NetBeans usage on a Mac for Java development?
Please don't include my current usage of Xcode in your analysis.
You missed the Rolls Royce of all IDEs. IntelliJ Idea.
If you can afford to buy a personal license, go for it. Edit: There’s a free Community Edition which is a superb way to get started with Java, Scala or Kotlin.
I like NetBeans on OS X for Java.
It seems like I spend more time configuring eclipse to get a decent java programming environment. With NetBeans the setup time is less and I can get down to programming quicker...
I would advocate Eclipse on the Mac for Java, mosly because I had a very good experience. I'm not going to bang on about its merits as an IDE, but here are some unexpected advantages I found:
When my employer switched IDE's to Eclipse I was way ahead.
Pretty much any language I fancied trying out had a free IDE somewhere as an Eclipse plug-in, so I have a very consistent multi-language development environment.
When I eventually went over to the Windows dark side I could use the same development environment, which was a huge relief.
But this is a bit of a religious topic, so expect to get a whole bunch of different opinions
Just to be sure you give them fair consideration, Eclipse and Netbeans have gone back and forth for a while. Eclipse used to be a good deal quicker because they didn't use Swing.
Now Netbeans has caught up (perhaps surpassed) and has a lot of momentum.
You will get more votes for Eclipse. Period. This is because it was better and more people use it--and it's just human nature to feel what you are using is the best and everyone should use it.
Because it was better does not mean it's better now. Netbeans has more languages supported and more all-around support--so it's growing faster.
Currently I use Eclipse--I've used both (and IntelliJ and TextMate and Notepad...) and I can tell you that Eclipse has exactly one feature over netbeans... Mylyn (it's been renamed, it used to be called Mylar). This thing is pretty damn cool, but few people seem to even know it exists.
So, if you don't know a bunch of keystrokes that already tie you to an editor, the up and coming is Netbeans--don't pass it up because of a bunch of Eclipse votes.
Better yet, get good with both--it can't hurt and makes me a lot more comfortable when a company requires one or another. Don't whine when they make you change.
Do not use Xcode - Java support in the later versions is very much lacking. Even Apple, who make it, suggest you use a different IDE. As for NetBeans and Eclipse, they both have their strengths and a large number of vocal followers. I suggest you try both and use whichever you find more comfortable.
I for one use TextMate and shell scripts. But I'm strange.
Well, I can chime in with Netbeans, it seems to work really well. There are some function key issues that I believe has a solution, I just haven't solved it. I've been quite happy with Netbeans. I like its "all in one out of the box" nature over the pick and choose plug in nature of Eclipse, but that's just a matter of taste.
Another vote for IntelliJ. http://www.jetbrains.com/idea/
I used both Eclipse and Netbeans. I like Netbeans more than Eclipse. From java editor point of view, both have excellent context sensitive help and the usual goodies.
Eclipse sucks when it comes to setting up projects that other team members can open and use. We have a big project (around 600K lines of code) organized in many folders. Eclipse won't let you include source code that is outside the project root folder. Everything has to be below the project root folder. Usually you want to have individual projects and be able to establish dependencies among them. Once it builds, you would check them into your source control. The problem with eclipse is that a project (i.e .classpath file) dependencies are saved in user's workspace folder. If you care to see this folder, you will find many files that read like org.eclipse.* etc. What it means is that you can't put those files in your source control. We have 20 step instruction sheet for someone to go through each time they start a fresh checkout from source control. We ended up not using its default project management stuff (i.e. classpath file etc). Rather we came up with an Ant build file and launch it from inside Eclipse. That is kludgy way. If you had to jump through these many hoops, the IDE basically failed. I bet eclipse project management was designed by guys who never used an IDE. Many IDES let you have different configurations to run your code (Release, Debug, Release with JDK 1.5 etc). And they let you save those things as part of your project file. Everyone in the team can use them without a big learning curve. You can create configurations in Eclipe, but you can't save them as part of your project file (i.e it won't go into your source control). I work on half dozen fresh checkouts in a span of 6 months. I get tired to recreate them with each fresh checkout.
On the other hand, Netbeans works as expected. It doesn't have this project management nightmare.
I heard good things about IntelliJ.
If you are starting fresh, go with Netbeans.
My 2cents.
It depends what you want to do. My experience with Java on the Mac is about a year old by now, but NetBeans had a much better out-of-the-box support for Tomcat (in particular) deployment, and generally seemed to be a little more user friendly. For instance, the Netbeans beta I tried out used forms for web.xml configuration, in comparison to Eclipse's plain ol' XML editor (and in Europa, at least, the XML editor's row redrawing was a little sketchy on the Mac).
That said, for that project, I wound up doing a bit of configuration (for a was a n00b) in NetBeans, then moved the XML config files over to Eclipse, and developed the rest there. As others have mentioned, the zillions of plugins are great, and in general the experience is just very consistent. Especially if you have to work on another platform.
If Eclipse had better OS X bindings (does it have any? I'm unaware), I would use that for Obj-C development, as well.
I have tested editors for Java extensively and prefer Netbeans to Eclipse by a significant margin. NetBeans has excellent support for Java, a very beautiful user interface and powerful features. It also has excellent support for C++ and I would choose for this it over, say, Visual Studio. Consider JCreator classic edition, an excellent place to start although not as powerful as NetBeans, easier to get into at first.
I'd also defend NetBeans plugins against Eclipse because although Eclipse is highly praised for the flexibility it is afforded by plugins I think this is largely down to the fact that the also very powerful plugins features of NetBeans are not shouted about so much, even though it is also very strong in this area. I have seen computational fluid dynamics applications based on the NetBeans platform, very impressive, I just don't think NetBeans developers make such a big deal over it because it's already a complete package from the moment you download it, powerful without any need for configuration with plugins.
If you're using Eclipse, be sure to use Ganymede (3.4) or later. They run great. The previous version (Europa) ran poorly on my Macbook Pro.
I happen to use Eclipse on my Mac (actually EasyEclipse which comes preconfigured with the most important plugins) and I must say it runs great. I have a less positive experience on Linux though.
I have also used NetBeans 6 recently and I was very impressed. It seems to have more functionality build-in. Most of the functionality is undoubtedly also available as an Eclipse plugin though, if you can find it.
Currently I have the impression that if you start developing Swing, Netbeans is your best option. Otherwise, Netbeans or Eclipse with a handy set of plugins are both excellent options.
If you do check out eclipse, give a thought to EasyEclipse (free) or perhaps even MyEclipse (not free). They come with the most usefull plugins preinstalled.
I've worked with both Eclipse CDT and NetBeans's C++ support, and I must say that in my experience CDT is far superior in both stability and in features. It's really impressive how well the CDT indexer works; the tooling is almost as good as Java's. I'm also a huge fan of JDT when compared with NetBeans for Java development. The workflow is just so much smoother, if only due to the incremental compiler (compile-on-save).
One thing about NetBeans though, its UI does flow a little better in the "Mac style", which is ironic seeing as SWT was created to provide a more native interface. The next release of Eclipse should be based on Cocoa (rather than Carbon, which is the current), but that won't be until next June.
Final note: the whole "in box" vs "plugins" issue is entirely moot and it has been since Eclipse Calisto (two years ago). Now, with P2 (the new update manager), it's dead easy to get different features in the IDE. I can start with a download and get a fully-functional JDT/CDT/Mylyn environment up and running within five minutes of installation (assuming a reliable internet connection).
I use Eclipse for development, and have had nothing but pain. It has more bugs than a bait shop, and is one of the worst written programs I have ever used. Use Xcode if you want to save time and frustration.
I'll suggest Eclipse because it has a zillions plugins and is almost a standard for Java development. But I've heard that NetBeans is really nice since their latest release specially if you want to do desktop application(Swing) .
I can't comment on Xcode since I haven't play with it.
Just from my experience, Eclipse is very large IDE. It needs more work to become better suited for the Mac environment. Netbeans is the best out of box experience. After installed, it is essentially ready to go. After I tried IntelliJ IDEA I forgot every other kind of IDE :P
But at the end no one wins over the other.
IMHO as USUAL !
Eclipse, because it has better support of C++ on mac. I used Netbeans long time ago, did not like it.
Use Java based IDE on mac only if you have to (especially when doing Java development). Xcode already supports C/C++ development, so no need to switch.
am I missing the point here or are developers still considering using Mac for java development?
I was a strong and rigid supporter of Mac as a development environment but ever since Apple's decision to not port java on later versions of os x my confidence has shaken a little.
And please do not even think about doing any j2EE deployment on Mac as it will bring about a tsunami of woes.
So long Java but I like my mac book pro too much .
FYI:I still use Mac for java development but sometimes I wish I were a python developer :(
From my experience, I use both Eclipse and Intellij (license) for J2EE development.
For overall of speed on IDEs, Intellij is faster and crashed lesser than Eclipse. I used Eclipse first and later on, I got used to Intellij and fell in love with it. However, Google's Android Studio is Intellij based. It's more modernized. Debugging is much easier especially you can evaluate a block code during the debug mode to see how it behaves instead of just inspecting objects. I highly recommend!