r/learnjava 22h ago

My path learning Java was terrible. i dont know if i will be able to re learn it

17 Upvotes

so last year. i decided i wanted to make apps. and decided to learn Java. i was 15 and stupid. so first thing i went through tutorial hell. i jumped from video to video. i also had no road plan. i just learn what was told on the videos. and i saw like ads about coding websites. and what matters with me is codedex. the first few levels were free. the rest were not. so i did the free ones then went to the projects and there i found out about swing. so yea. i was basically level one and was already learning swing. thats a dumb move. i kept my focus on swing and did some very simple apps. and then i realized that this was literally a waste of time. i knew basically nothing. but when i wanted to re learn it i felt myself skip skip skip because some things i knew. and lowkey giving up on Java.


r/learnjava 9h ago

How do you check null safety when publishing a Java library?

5 Upvotes

I’m gearing up to publish my first Java library in the next few weeks. I’m using jspecify for null checking, with `NullMarked` annotations on my packages. Using my library requires implementing a subclass of an abstract class and overriding a method whose return value is marked as `NonNull`.

When I implement a subclass from my test suite, if I don’t have NullMarked enabled or if I don’t attach a `NonNull` annotation to the overridden method then I get a warning: `Not annotated method overrides method annotated with NullMarked`. So far so good; this seems like the tool doing its job by catching a potential source of errors.

Here’s my problem though: what if a consumer of my library doesn’t want to use jspecify? Am I dooming them to eternal build warnings? Is there a better way for me to have null checking in my library’s internal implementation and to publish it with useful `NonNull` annotations without locking consumers into a particular null checking dependency?


r/learnjava 13h ago

About Resilience:I failed my java 3 times ,but end up with a B

4 Upvotes

Life is full of setbacks. The only thing that matters is you keep pushing through them. It’s totally okay to feel frustrated along the way — but trust yourself, you can absolutely do it!


r/learnjava 22h ago

How do you structure cross-cutting concerns in a real Java modular monolith?

4 Upvotes

I'm trying to understand how people structure a reasonably large Java/Spring modular monolith in practice.

I understand the general idea of package-by-feature / DDD / bounded contexts fairly well. For example:

orders/
submissions/
users/
catalog/

And inside a business module you can have things like:

api/
application/
domain/
infrastructure/

What I'm struggling with is everything that doesn't fit neatly into a business domain.

For example:

  • security
  • authentication / authorization
  • CurrentUser / UserContext
  • email notifications
  • file storage / uploads
  • PDF generation
  • reporting Jackson
  • configuration Web MVC
  • configuration messaging
  • observability
  • global exception handling

Where do these things actually live in a real modular monolith?

For example, suppose I have:

submissions/
orders/
users/
notifications/
security/
config/
infrastructure/

A submission is created and I want to send a confirmation email.

Would you do something like:

submissions
|
| NotificationRequested
v
notifications
|
v
EmailSender

with notifications being an application module, and EmailSender / template rendering / SMTP being infrastructure?

Or would you put the email infrastructure outside the notifications module?

Similarly, where would you put CurrentUser? If every controller needs the authenticated user, should it be exposed by a security module? Does that mean all business modules depend on security?

And what about Spring Security annotations such as:

@PreAuthorize("hasRole('ADMIN')")

on controllers belonging to different modules?

I'm also wondering how this relates to Spring Modulith. I understand that it can enforce application module boundaries, but I'm not sure what the recommended approach is for these cross-cutting/technical concerns.

I'm specifically interested in real-world production codebases, not toy/tutorial examples.

How do you normally structure this in a large Java/Spring application?

If you have examples of mature open-source projects or architectural documentation that demonstrate this, I'd really appreciate them.


r/learnjava 5h ago

Guidance for full stack Java course

1 Upvotes

So I know the basics and OOPS concepts of java and I want to learn about spring, spring boot and microservices all the stuff which will make me industry ready. I have read a lot of reviews and it making me more confuse which to follow so what will be the best course for me also I do DSA with Java.


r/learnjava 15h ago

UofU transfer student needing help

0 Upvotes

Hey everyone,

I’m a second-year transfer student at the University of Utah, and I’m feeling pretty overwhelmed about CS 2420.

My previous programming experience is mainly Python, and I’m now trying to learn Java. I understand basic programming concepts, but I’m finding the transition to Java harder than I expected.

I’m especially struggling with the basics and knowing what I actually need to learn before getting into the CS 2420 material. I've already asked my professor for help but he just said use chatgpt and google.

I’m also pretty stressed because I’m a transfer student and feel like I’m behind everyone else. I have some programming experience, but Java is making me feel like I’m starting over.