r/javahelp • • Sep 18 '22

I would love to use Java in my personal projects, but it is too heavyweight, is there a solution?

26 Upvotes

I study Java because I like back-end and there are a lot of opportunities for Java developers in my country. And, as a person who like making stuff through programming, I have ideas for personal projects. However, it's problematic for me to use Java in my personal projects:

  • Desktop: Java programs are too heavy, I tested a program called AsciidocFX (created with JavaFX) and it consumes almost 900MB RAM!

  • Back-end: I know that Java shines in the back-end, it's a great technology, but my back-end projects are meant to be run in VPS with low capacity (only 1GB RAM, or even less!). Java apps are heavyweight, I don't think I could run more than two SpringBoot applications

I know that I can use other languages for my personal projects, and I already them (like JavaScript and C, and I am seeing Go and Rust), but I would love to know if I could make Java a viable "toy language" for me, but that will only will be possible if I can reduce the memory footprint


r/javahelp • • Jan 23 '21

Whats the difference between "i++" and "++i"

26 Upvotes

Ive been working on a problem an my only error was that i had a "i++" instead of "++i" tbh i dont know whats the difference so i decided to ask if someone can help me with this


r/javahelp • • Jul 31 '20

Where to throw exceptions in a Spring Boot app?

26 Upvotes

Suppose I have standard controller -> service -> repository set up and an endpoint like GET product/{id}.

If the ID doesn't exist which layer should throw the exception? Should the repository do it, or should it return null and then throw the exception in the service or controller to be eventually caught by the controller advice?


r/javahelp • • Jul 24 '20

How do I get started on learning Java?

26 Upvotes

Hi guys, 22F from Singapore here. I'll be taking a module called "Object Oriented Programming" next semester and it will taught entirely in Java.

Since I'm pretty free now, I was thinking of learning Java before the semester. Is there any tips or website you guys recommend me to look into to get started on learning Java?

I do have experiences coding in Python but I heard Java is next level as compared to python.

Any tips on Java will be really appreciated!! Hope to make some new friends here to discuss about programming too.


r/javahelp • • May 23 '20

Observing an ArrayList of Objects for change in their instance variables in JavaFX. Not a Question.

26 Upvotes

A bit of a backstory:

I was building a P2P file-sharing app in Java. Everything was going alright, my communication protocol was ready, everything was structured and OOP adherent.

I have no idea why but I decided to build a front end GUI in Java for my app. JavaFX was the weapon of my choice and I thought that I'd be ready with a working UI in a couple of days.

It was rough. I blame my shallow knowledge of Java but boy did it hurt. For the past 2 days, I've only learnt how to make sure that an ArrayList of Objects is observed and changed in the GUI as other threads do various operations on it.

Am I stupid or is JavaFX complicated? Is GUI programming in general complicated? Should I switch fields or learn something else while I still have time because I've never struggled so hard trying to get something work.


r/javahelp • • Feb 04 '20

Switching from C# to Java

26 Upvotes

Hi,

can you give me a list of things i should be aware of in the java world? Like really important libraries, concepts etc?

The thing is i know C# really well, but i dont know what i dont know in the java world, so i cant really look it up.


r/javahelp • • Nov 30 '19

How to keep learning and improve my skills?

26 Upvotes

I have been learning java for some time already and I feel like I am making almost no progress. My main prpblem is that while I like naking new projects, I only use stuff I already know and rarely learn new skills and concepts. What is the best way for me to keep improving and solve this problem of mine?


r/javahelp • • May 22 '19

Codeless What exactly is an API, and how do I use one?

26 Upvotes

I don't understand how to get the values after requesting, and how to request in the first place.

For example, how would I go about using the Google Map API?


r/javahelp • • Apr 12 '19

Why do the official oracle java docs look like its been from the beginning of the web?

26 Upvotes

I could create a chrome/firefox extension so that it makes the site a bit easier to read, Will anyone will use it?

I have studied java in my college days, Now I feel like I should to get back to java and try some experiments. There are countless java tutorials and I am pretty happy with those. But I went to the official java docs site https://docs.oracle.com/javase/tutorial/java/index.html, and I feel like I went back 50 years. compared to MDN, python.org, or php.net I feel very sad towards the site.

Maybe it's because of the high res display I use, I find it very hard to read because of the looong horizontal lines, and poor font choices. and it's really unresponsive, Any reason they have kept it that way?


r/javahelp • • Mar 13 '19

Codeless Mastering Skills Beyond Java as a Professional Software Engineer

26 Upvotes

Hello all, I am seeking some guidance, and help from colleagues. I consider myself a junior software engineer with proficient enterprise level Java skills. However, though I continue to learn deeper topics about Java, I want to master the entire "process". What I mean by that is mastering topics such as Maven dependencies, Jenkins builds, etc. In other words, I want to be able to build an enterprise level Java application from scratch, even if it is just a hello world. What resources can I turn to, aside from the tool documentations, that will even just as much as outline this process? What did you do as a software engineer to better understand this overall process, any advice is welcome. Thank you.


r/javahelp • • Oct 31 '15

Can we get some ELI5 definitions of the following concepts?

26 Upvotes

Can we get some ELI5 definitions of the following concepts?

Everytime I find definitions online, there is always another concept embedded inside the definition that I don't know. I thought it'd be useful to gather some basic, new-programmer friendly definitions that both myself and others can learn from. Hopefully this type of post is not against the rules.

I will add definitions of the following words based on what you guys have written. I myself do not know some of these words hence why I am writing this. Thank you!

  • Instance: If we say that a class represents a type of thing (like a house), then an instance is that thing. You can think of an instance as being one of the houses built according to the house blueprint.

  • Class: You can think of a class like a blueprint, e.g. of a house. Every house will have a number of doors, a number of windows, a color, and other attributes. A class is simply just a representation of what a house may look like, and contains properties that all houses have in common (even though those properties themselves might be different, e.g. one house might be white while another is blue).

  • Object: An object is simply an instance of a class. To continue the house analogy, an object would be a specific house built according to the house blueprint.

  • Interface: A common set of methods that all implementors will have. The analogy here is a remote control. Most likely, you don't know how a TV remote works on the inside. However, you don't need to know that; you just need to know how to use its interface - the buttons Play, Stop, Rewind, Channel Up, etc... Even if you get a completely new remote from a different company that works in a completely different way, you'll still know how to use it because the two remotes have the same interface (they both still have the buttons Play, Stop, etc...)

  • Unit Class:

  • Enum: Enums are like classes, except they have predefined instances. They're useful if you have a limited number of things you want to represent, e.g. a card suit. Instead of creating a class called CardSuit and then having to create the objects for spades, diamonds, clubs, and hearts yourself, you can use an enum to predefine those instances since you know you won't ever need more than those four suits.

  • Abstract: A term used to describe a property of a class that will always vary between instances. To come back to the house example, suppose every house is capable of automatically locking its doors because that's how it was designed in the blueprint. However, not every house has the same locking system, so the way to lock the doors will be different for each house. We can say that the lockDoor method is abstract, because although every house is capable of locking its doors, how it does it is up to the individual house.

  • protected / default: A term used to describe attributes of a class that can be inherited by its child classes. Suppose our house blueprint is used as the basis for another house blueprint, e.g. the blueprint for a smart house. Which properties of the house will also be in the smart house? That's where access modifiers come in. The properties of a class that are marked "public" are can be accessed/used by everyone. Maybe your home has a doorbell, and anyone will be able to ringDoorbell(). "Protected" properties can only be accessed by the same class or child classes. "Private" properties can only be accessed by the same class. "Default" (also called package-private) properties can only be accessed by classes within the same package.

  • this: A keyword that refers to the specific instance of a class, specifically the one you're in. Maybe you're inside a house and want to say, "let's open the windows". You could then just write this.openWindows().

  • implements vs extends: implements is a keyword used when you want to make a class have a certain interface. For example, a Toshiba remote control should have the universal buttons on it, so to ensure that it does, you could write class ToshibaRemote implements RemoteControl. extends is a keyword used when you want to make a class inherit from another class. For example, a smart house is really just a house, so you can base the smart house blueprints from the regular house blueprints; you could write class SmartHouse extends House.

  • Package: A grouping of classes in a specific location (i.e. in the same directory). Maybe your house blueprint and your storage shed blueprint are grouped together in a package called "Buildings".

  • Threads: A thread is one path of execution in a program. Suppose you have 3 hampers of laundry to do, as well as one washing machine and one dryer. If you take one hamper, wash it, dry it, and only then start with the second hamper, you would take a long time to do laundry. Multithreading allows you to take one hamper, wash it, and dry it, and then while the first one is drying, you can take the second hamper and wash it. In essence, each hamper is a job, and the process of washing and drying laundry is a thread. Multithreading lets you process the second hamper at the same time as the first. (Not sure if this was a good example, but I'm running out of juice here.)

Also, if there are any concepts you are confused about or would you would like to discuss, let me know and I will expand the list!

EDIT: I will add definitions from the comments as more comments come in so I can be sure the definition is correct.


r/javahelp • • Jan 06 '26

Best way to learn multi-threading in Java?

25 Upvotes

I just started learning Java and aiming to catch up to senior level.

I saw that there are 5-6 ways to do multi-threading (Executor, Virtual threads, CallableFuture etc.)

Is a multi-threading technique picked based on use case, or they are iterations throughout Java versions

And what can I do to practice them? Which one should I use in interviews?


r/javahelp • • Dec 07 '21

What should a junior java developer know?

25 Upvotes

I got decent knowledge of Java, C++ and C but i dont know very good JS, HTML and CSS even though they arent that hard to learn. I usually use Eclipse, Visual Studio and Visual Studio 2019 and i know GIT.I have recently started to learn React and i only have bachelor+integrated master in CSE so no real master degree or phd but i only want to be a software developer so they are enough.

After University i have the following projects.. a simple login system(correct/wrong password/username etc not database connected no register), calculator in Java and GUI, simple website with information displayed, a todo list in react, a simple fetch data with api in react it just takes data from other site and it shows to my site.

Any help with next steps cause they are not enought to get a job? maybe some recomented good projects cause i feel mine are small simple and not profesional. Ofc i got a cv and github profile with linked in on my cv.


r/javahelp • • Nov 23 '21

Codeless Does java have a package manager?

25 Upvotes

I have been developing test automation projects on C# and Python for a while. I am using NuGet/PiP to install dependencies such as Selenium.

I will be switching to another company and they use Java stack. I am trying to understand how java environment works.

What is the easiest way to install dependencies on Java?

Are there any easy to use package managers for java that I can use?


r/javahelp • • Sep 29 '21

Unsolved Can someone explain to me the difference between Spring, Spring MVC and Spring Boot?

25 Upvotes

Can somebody just give me an idea as to what all things come under Spring, Spring MVC and Spring Boot, so that I can look up and try to learn things on my own. It would help me a lot if you can list out the individual things that each include. I am just starting out and I am very confused by these 3 terms. I have searched so many websites but their definitions and differences are very confusing. It didn't give me a clear understanding of these things. Also if you could suggest any good resources to start learning spring boot it would help me a lot.


r/javahelp • • Oct 28 '20

Codeless Is Anyone Able to Migrate OAuth 2.0?

25 Upvotes

I have been building a RESTful Spring boot application. The Spring Security OAuth project is deprecated and the latest OAuth 2.0 support is provided by Spring Security. Has anyone managed to migrate OAuth 2.0 by following the migration guide? I do not understand anything from the guide and I do not know what I am supposed to do.

Here is a snippet from my project just to show what has been deprecated. Every implementation is deprecated...

https://imgur.com/a/DQGQYFI


r/javahelp • • Jul 20 '20

Codeless Best resource to learn LWJGL3?

25 Upvotes

Best resources to learn LWJGL3?

Hello! I’ve been trying to follow along with the book 3D Game Development in LWJGL, although I feel like it’s a bit too advanced/hard to follow for me, a total beginner to LWJGL. As a result, I’ve been trying to look across the internet for better beginner-friendly resources to learn LWJGL3. Any ideas?

Thanks!


r/javahelp • • Jun 11 '20

what is the difference between ArrayList amd List?

25 Upvotes

i was going through collections in java and i implemented the ArrayList in the following ways:

List<Integer> list1= new ArrayList<Integer>(); ArrayList<Integer> list2= new ArrayList<Integer>();

I know that by creating the reference of List, I can access all the methods of List class but I don't feel any advantage of it.


r/javahelp • • Mar 13 '20

Solved What do ~ and ^ mean in Java?

25 Upvotes

I can't find it on the internet, what does it mean?

Edit: thanks everyone!


r/javahelp • • Dec 17 '19

Fresh grad getting ready for java position

25 Upvotes

I'm a fresh university graduate that got a return offer for a Java developer position starting in February. In my internship exit review, I was told that my Java OOP design skills and understanding of the main software architecture was lacking. I completely agree as I used Java and worked within a SOA for the first time in the position.

I want to improve these skills before I start my job, but I'm pretty unfamiliar with the Java ecosystem and resources. I've already picked up my copy of Effective Java and plan on reading it thoroughly, but I'm at a loss for how to improve my Java-centric OOP skills and understand service-oriented architecture better.

Are there any good resources out there on OOP design with a Java focus, and what are the main frameworks for SOA in Java I could work on building some toy applications with? Any help or other suggestions are greatly appreciated.


r/javahelp • • Aug 21 '19

Is making Android Apps with Java a good way of learning Java?

25 Upvotes

Hey guys, so i have to learn Java for my programming class in uni, it's still quite basic stuff, no databases, spring etc.

I've been practicing arrays, hashmaps etc etc. by making random small programs in IntelliJ and its quite uninspiring practice. So i thought it might be more fun making Android Apps that i could actually see the progress in and end up using, but is it a good way to learn the Java language? I won't be making apps in my programming classes, only actual pc programs.


r/javahelp • • Jul 05 '19

why does this print out a negative number?

25 Upvotes

int value = 0;

do{

value += 10;

}while(value > 5);

System.out.println(value);

}


r/javahelp • • Jul 01 '19

What is wrong with my method for finding the nth fibonacci number?

25 Upvotes

Here it is:

public static int nthFibonacciNumberLoop(int n){

  int fn = 0; int fn_2 = 0; int fn_1 = 1;

     if (n <= 1)

         return n;

     else {

       for(int i = 1; i < n;i++){

       fn = fn_1 + fn_2;

       fn_1 = fn;

       fn_2 = fn_1;

  }

         return fn;

  }

  }

It is correct for the values 0,1,2, and 3. incorrect for 4, 5, 6, 7, 8, ...

Why?!


r/javahelp • • Dec 22 '25

Which IDE do you prefer for Java code NetBeans or IntelliJ?

24 Upvotes

from your experiences which one is most comfortable to use?