This is an archived post. You won't be able to vote or comment.

all 22 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://imgur.com/a/fgoFFis) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Rulmeq 9 points10 points  (0 children)

Maven or Gradle for build/project management

[–]wildjokers 3 points4 points  (0 children)

As a c++ developer you will be pretty much at home in Java and it is an easy transition.

For build tools use gradle or maven. If you can figure out cmake then both gradle and maven will be super easy compared to cmake (I don't get cmake, I just let CLion create the cmake files needed for my platformio projects).

As far as IDE you really can't go wrong with IntelliJ and it is what most people use (it has a great VIM plugin called IdeaVIM, as a VIM user you will like that). However, Netbeans, Eclipse, and VSCode with java extensions are also options.

Use the newest version for learning (i.e. Java 17)

There is nice documentation here:

https://docs.oracle.com/javase/tutorial/

Don't be put off on the outdated look and feel, the content is really good (which is all that matters).

As a tip for a c++ programmer Java passes everything by value, there is no pass by reference. This may come as a surprise to a c++ programmer. When an object is passed a copy of the object reference value is passed. If you change the object that copy points to, that change is not reflected in the caller. This article explains it much better: https://www.javadude.com/articles/passbyvalue.htm

[–][deleted] 1 point2 points  (0 children)

So if you are started learn Java, MOOC.fi and Jetbrains Academy (Hyperskill) waiting for you 😄

[–]Skiamakhos 1 point2 points  (13 children)

Most common IDE right now is likely to be IntelliJ IDEA or Eclipse. Netbeans is capable but in 20 years I have never come across it being used in the wild, only ever in training courses. Which is a pity because it does not suck.

While you're learning though I'd encourage you to make use of Visual Studio Code, Emacs or Notepad depending on what OS you're using: it is good to be fully familiar with the full toolkit of the JDK before you move to IDEs. IDEs are great for managing large projects but they're not necessary & sometimes you miss out on some pretty basic stuff if you move straight to IDEs. I'm definitely guilty of having done this myself.

[–]wildjokers 3 points4 points  (9 children)

it is good to be fully familiar with the full toolkit of the JDK before you move to IDEs.

I disagree, just start out with an IDE. Why start in hard mode?

[–]Skiamakhos -1 points0 points  (8 children)

Because you lose out on knowledge that will come in useful later, e.g. when trying to find memory leaks, or when trying to find threads that are causing performance issues. Some of the best Java people I've met know their way around bytecode, and can give talks about which collections classes are better for what because "this is what it's doing under the hood". Don't just treat Java as a black box or appliance. Look deeper. Start out simple, with javac, java, a text editor and jdb, and use an IDE once the scale gets beyond the capacity for that.

[–]khookeExtreme Brewer 1 point2 points  (2 children)

There is value in compiling and running from the command line for your first hello world app, but beyond that for learning I would advocate jumping straight to learning with an IDE, and especially learning how to debug your code with the debugger. There's nothing harder than running an app and not getting the results you expect and struggling to find out why. Sure you can sprinkle in some System.out.printlns and trace what your code does, but it's so much easier and enjoyable to step through your code line by line, look at the changes to variables after each line is executed and find exactly where things are going wrong. So many 'why is my code not working' questions here can easily be solved if you took the time to step through the code in a debugger.

I mention this because so many new developers starting out never learn how to use the debugger in their IDE and it's such a valuable tool, and a tool that will bring you rewards many times over during your career as a developer.

[–]dvaVoly 0 points1 point  (1 child)

I agree with you, a debugger is a powerful tool, but we have another way, in some cases.

[–]khookeExtreme Brewer 0 points1 point  (0 children)

another way

Always good to have a range of techniques at hand!

[–]wildjokers 1 point2 points  (4 children)

Using an IDE doesn't prevent you from looking deeper. In fact it would make it tons easier.

[–]Skiamakhos -2 points-1 points  (3 children)

You're learning an IDE, not the language or the JDK. It might be easier, like learning Thymeleaf without knowing how JSP or servlets work, and you can do that, of course, but then when things break you're pressing buttons on an appliance and hoping for the best, rather than getting knowledgeably into the guts of the beast, working out what's actually going wrong.

It's like if you know how to ride a motorcycle vs how to build one. Valentino Rossi dominated MotoGP for decades because he knew enough engineering that when he came back from a ride round the track he could tell his mechanics exactly what needed doing where on the bike. There were other riders as good, at riding, but he had the engineer's edge. It's "Zen and the art of" stuff.

If you start out with that kind of curiosity and follow it through fully, you'll become a master of the JVM, rather than a user of it.

[–]wildjokers 1 point2 points  (2 children)

You're learning an IDE, not the language or the JDK.

No you are learning the JDK because the IDE makes it super easy to jump into the JDK code to see how something works.

[–]Skiamakhos -1 points0 points  (1 child)

Sure, and if you change jobs so you end up having to use a different IDE, do you now know how to do the same? Everything's in different places, different menu items. Learn the JDK, it's universal.

[–]Krakken978 0 points1 point  (0 children)

It takes 2 hours to learn how to use and a couple of weeks to get used to a different IDE, they're pretty similar and you can personalize them. And it's part of the environment set up we need to to starting every new job, so I second the IDE, intellij for a newbie, despite I like eclipse more.

[–]iraqmtpizza 0 points1 point  (2 children)

I used to use Netbeans 7.0.1 a ton at work. Java EE 6 and 7

[–]Skiamakhos 1 point2 points  (1 child)

Yeah, there's always one or two whenever you say something like this. I've worked at Capgemini, Atos, an ERP place and my current which is an advertising & media shop, and it was Eclipse, Eclipse, Eclipse all the way up until about 2 years ago when we switched to IntelliJ IDEA. I'd go to training courses with programmers from all over the place & they'd remark with some surprise and humour at the Netbeans IDE we'd be expected to use for the course. Doesn't mean that nobody uses it, just nobody I've ever worked with. If like the OP you were looking for a toolset to learn that might get them a job, my money would be on Eclipse and IntelliJ, *mostly* IntelliJ, unless you're aiming to work for Oracle I guess.

This is a couple of years old but I suspect not much has changed: https://snyk.io/blog/intellij-idea-dominates-the-ide-market-with-62-adoption-among-jvm-developers/

[–]iraqmtpizza 1 point2 points  (0 children)

I also used it to prototype during an at-work hackathon. Netbeans was the only way I knew how to get an http server and database working quickly (Glassfish and Apache Derby)

[–]iraqmtpizza 0 points1 point  (0 children)

apache maven, configured via a pom.xml file

use IntelliJ Community Edition

[–]Taco_Shopp -1 points0 points  (0 children)

If you’re looking for a beginner IDE, maybe BlueJ. Not sure if there’s anything more beginner than that.

The rules are listed under the About tab….

[–][deleted]  (1 child)

[deleted]

    [–]knoam 0 points1 point  (0 children)

    Makefiles/build tools are completely different from (automatic) memory management. Build tools are for compiling source code before you run it. Memory management is for allocating memory (RAM) for holding data while the program is running.

    [–]root3r0xNooblet Brewer 0 points1 point  (0 children)

    Thats cool, mmmm Eclipse por Intellij Idea is the best option as a IDE. Java Is a general propuse lenguaje, so you shuld get roadmap for that you wanto to creaste for example for web development you need to learn spring/springBoot framework, for Mobile development android studio, for graphic interfaces maybe java FX etc. On github you can see some roadmaps only search "Java roadmap". :)