If I've Downloaded JDK, Do I Need to Download Eclipse Too? - java

I'm pretty new to programming and to Java, so I'm really not sure.
I know that JDK has its own compiler and the JRE too so would I really need Eclipse?

You need the JRE to run java code on your computer and the JDK to write it. However, many programmers tend to prefer an IDE (Integrated Development Environment) to use along side for actually writing the code, debugging, and execute it much more efficiently. Eclipse is a good example of one, and one of the many used/preferred IDE's (in my opinion at least) out there. However, others exist too:
DrJava
Netbeans
BlueJ
JCreator
These editors are much more preferred because they make it easier to learn / write code. However, you may choose a normal text editor (like sublime, atom, textedit, notepad, textmate, etc..) or even the command line. Mac & Linux have "vim" built in which is a command line editor too which I tend to prefer.

Yes, the JDK and JRE are necessary to run java but Eclipse is the tool that will allow you to code, debug and execute easier.
Think of JDK as the engine of a car and Eclipse or any other IDE like the wheel.

Related

Java beginnings using Netbeans

I'm just about starting to learn Java. Reading about, I installed Netbeans.
Running Apache Netbeans IDE 11.2.
The Java version is 13.0.2.
I'm promptly follow the Quickstart guide on the netbeans website.
File>>New project>> Java >> Java Application.
Errhmm, I don't have this 'Java' option. All I have is
So what's the difference between Java & Java with Maven/Cradle/Ant . At this point in time, I intend to start with basics of Java programming and then move on from there. SO which option am I meant to be starting with? If I'm missing Java, how can I add it ? Going through the installation procedures didn't give me any option to choose from.
p:s - this is all running on Mac OS Catalina
You can start with any of Java with ... option. I use Java with Ant option.
Maven, Gradle, Ant are build-tool addons i.e. they provide additional support if you intend to use any of these as your build tool.
When you choose Java with Ant option, it will let you create, compile, debug and run your Java programs without requiring anything additional. After using this option, you will get an interface as shown in the screenshot given below:
Maven, Gradle and Ant are build tool which allows you to compile, unit test, package and (if you like) even deploy your Java applications (they do support other languages btw).
I suggest you to start with one of those (Maven is very popular and probably a little bit easier than the others) instead of relying on your Java IDE specific features.
Once you master a build tool you can change IDE (IntelliJ is also a very good option ;-)) and will still work as before. You also find plenty of resources and help (like Stackoverflow) if you need hit some problems.
Best of luck!

invoke gdb to debug java programs

i am pretty new to programming, and having some trouble with debugging java programs. I try to use gdb to debug my java program, but no matter how hard i try, it still does not work at all.
The error message in the minibuffer of emacs(GUI) is always "No such file or directory , gdb". I am sure that my currrent directory is the the same as the sourcefile and the compiled file(executable file compiled with "javac -g xx.java") .
So, my confusion is that: Does the error has something to do with:
1. wrong syntax of invoking gdb (used Meta gdb xx )
2. what is the executable java file for gdb/ how gdb identify them
3. is it possible that my installation of EMACS is incomplete, as i input the gdb to the command line(Win8 system), NO gdb prompt appears at all(something like(gdb....))
Error No such file or directory, gdb
If the error message is coming from emacs, it means that gdb is not installed. To fix it, install gdb. Note that gdb is not part of emacs, it's a separate program. If you get gdb with a bundle, it would usually be part of gcc, the GNU Compiler Collection, not Emacs. The source is the same - FSF (Free Software Foundation) / GNU Project (GNU is Not Unix), but it is different / separate packages.
If the error message is coming from gdb, it means that gdb cannot find the executable. See next point for this.
However, looking at your description, it's more likely that gdb is not installed at all.
gdb cannot debug Java directly
gdb cannot be used to debug Java programs in general, it can only be used to debug Java programs that were compiled into binaries using gcj. See also Java Debugging with gdb from its manual.
You may want to go for jdb instead, which is the Java Debugger that comes with a JDK.
Emacs for Java? Use an IDE instead
Emacs is a great text editor indeed. The jokes that people make about Emacs, like "Actually Emacs is a Common Lisp implementation for developing computer games which happens to have one of the two best text editors as a demo app" are a pun on its greatness. I'm a vim user myself, and I have only the deepest respect for Emacs and what it contributes to computer science (i.e. Common Lisp).
But no matter how good Emacs and vim are, these days the IDEs beat them to it.
The three most popular Java IDEs
Eclipse
NetBeans
IntelliJ IDEA
I recommend IntelliJ IDEA and have my reasons for it, but you can't really choose wrong. They're all good!
What do the IDEs offer?
Syntax Highlighting
Bleeding edge with the latest Java versions
Hundreds of additional checks (especially IntelliJ IDEA: Inspections)
Lots of typical edits automated (especially IntelliJ IDEA: Intentions)
Refactoring
Java Debugging
Java Decompilation
Code Coverage
Code Completion
Integrated access to JavaDoc help
Integration with Unit Test frameworks
Integration with Version Control Systems
Integration with Android SDK and Emulator
Integration with the typical Java build tools Ant, Maven, Gradle
A lot more with those many plugins
Several of these things are also offered by Emacs or vim - but not all of them.
What about my Emacs (or vim) knowledge?
I'm a vim power user myself, but I wouldn't use vim for any Java that exceeds Hello, World, because an IDE like IntelliJ IDEA is just so much better. One argument that is often made is that we users invest a lot into editors like vim and emacs learning all their shortcuts for productivity. This knowledge does not need to be lost. IntelliJ IDEA has an IdeaVim plugin for Vim users and an emacsIDEA plugin for Emacs users. I don't know, but I could imagine that the other IDEs have similar plugins.

How to disable ant in eclipse

I am new to Python and only installed Eclipse + Pydev as the autoformatting possibilities would help me with the annoyingly stringent indentation rules of Python, which weren't being caught by Geany for example. (These have cost me HOURS of futile searching for even very simple intentaion problems).
I don't need Java or Jython (yet), so how do I disable the interference from Ant at Run time?
Or is there another IDE with autoformatting that doesn't need Java support that would be better suited?
Ant doesn't run in Eclipse at runtime unless you have an Ant builder on the project. (it might be something else causing whatever behavior is bothering you.) That said, Eclipse is a heavy IDE if you only want it for the formatting help. If you are using other features like debugging, PyDev is helpful.
You might consider a lightweight IDE. NotePad++ has a Python plugin.

basic and minimal java development setup

I am using Ubuntu and I would like to know the basic tools to install so I can begin develop in java.
With 'minimal' I mean the most transparent way without fancy tools and stacks etc. Like for minimal C programming you just write code and run 'gcc file.c -o myapp'.
Thank you
Just download JDK.
Minimal tools are javac for compiling and java for executing JVM. Both are in bin directory.
You need to install JDK to start with hello world
Eclipse IDE. It's probably the most comprehensive Java IDE. I understand that isn't what you're looking for but light, simple ones like JCreator are not free to use. I don't see the sense in developing without an IDE of any kind.
Install the JDK. An IDE is a minimal requirement for development in Java. Not all developers would agree, but IMHO its the most productive way to develop in Java. I suggest IntelliJ CE which is free.

What's the preferred Java editor for OS X

I currently use Textmate for most of my editing, but am taking a Java course and am wondering if there's a better editor out there, especially one that might have some form of intellisense or active debugging.
Most, if not all of the usual suspects when it comes to Java IDEs work on OS X. I've personally used Eclipse and NetBeans on OS X - in fact I still have NetBeans installed as it's also a good environment for writing Ruby code.
Of course if you're just looking for an editor and not an IDE, you might want to try out Aquamacs...
If you want code completion, you are not looking for an editor but an IDE.
Eclipse, Netbeans, IntelliJ IDEA all work well on OS X. JDeveloper I have not tried but the generic version runs under OS X.
Choose the one your instructor recommends (because then he can help you getting started).
Eclipse works okay. It has awesome features, but is somewhat buggy / crashy. It has very good "look and feel" for a Java app on OSX. Feature parity (as best as I can tell) with Windows/Linux.
I use Eclipse quite heavily on OS X. Lots of plugins, artifact downloading/caching, building, etc. Just make sure you've got the latest Java installed on OS X, and maybe verify that your system will launch Eclipse using Java 6, 64-bit, and make sure you're running Eclipse 3.5, and you should be good to go.
I leave mine running for days at a time, but your mileage may vary depending upon plugins.
I like NetBeans and Eclipse, but Xcode comes with Mac OS X and TextWrangler is a great stand-alone programming editor.
Go for eclipse. Faster than Netbeans and has lots of plugins.

Categories

Resources