JCH
Java Community | Help. Code. Learn.
We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!
JoinJCH
Java Community | Help. Code. Learn.
We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!
Joinshared database for multithreading
can someone help me with the trade-offs and pitfalls of creating a shared database?
im building an uber-like project that needs to save a list of drivers and their state -as in free, or occupied in an another ride- across all threads.
can someone guide me? its a console app....
JDTLS' code action/completion suggests really out of place things
I'm trying to use Neovim whenever I can, partly to learn it and partly because I just prefer it (when it works). One big annoying problem I run into constantly is the suggestions sometimes just breaks and suggests things like
Listfrom org.hibernate instead of java.util.
The fix is rather simple, just relaunch Neovim (just restarting the LSP sometimes works, but faster and more reliable to just quit it completely), but when I work on something new I may not notice that it happened again and I assume the autofill is correct.
From what I've seen, other people have had similar experience with JDTLS on other editors so I don't think this is an LSP/neovim config problem (since it does work nicely otherwise, even better than intellij in some rare cases). None of the fixes I've seen (change jdk version, deleting JDTLS cache, etc.) works. I also tried using some Java-specific plugins for neovim but saw no or worse effect....
Facing difficulties with the builder pattern
For a school excersise I need to Fix tests and code using the builder design pattern. However I am stuck and I don't know how to proceed. Specifically where and how I should Implement the builder.
Here is a link to the repository with the work I have so far, any help is appreciated
https://github.com/JuupStraathof/computerfactory...
Synchronized lists
Hey guys!
A bit of concurrency question here. I was using
CopyOnWriteArrayList to have a threadsafe list that I can write to from different threads. The whole purpose was that I need to make a multitude ap API calls, process the information and save it to a collection. The API calls could be run concurrently, so I would make the process faster, so I needed a threadsafe implementation of List. I found that CopyOnWriteArrayList is such an implementation, but it wasn't working well. I know how many items I need to have in the collection after finishing, and that amount wwas always lower. I tried then using Collections.synchronizedList() which had a better result, but still not the amount I needed. When I did the process sequentially, then I got the exact number of items I needed. So something is wrong with synchronization, or is there something I need to know, that I am not aware of synchronized lists in Java fro them to be truly threadsafe? Coding wise I initialized the array with Collections.synchronizedList(), and used virtual threads for the API calls, in which the writing is done.
A sample of what I did:
```java...Dev Setup for Backend Developers (macOS)
Do you struggle with installing and configuring essential tools one by one?
I had the same challenge — so I built an interactive installation script to solve it.
With just a single menu, you can easily install and verify:
🔹 Java 25 (Adoptium GA/EA or OpenJDK fallback)...
TCP sockets and multithreading with java
hiiii divas, i need people experienced with these topics to baby teach me how to build my uber-like project.
PLEASEEEE BE PATIENT AND NICE W ME !!!! IM A NEWBIE AND IM A SLOW LEARNER
u can check the project here --> https://github.com/HanaATawfik/Uber-like-Application...
Upcasting
Hello all, I have a java related question related to upcasting. What is the point of upcasting, I dont see how its useful when a subclass' objects already inherit that of the superclass.
JavaFX error
In my project coded with JavaFX, I get a JavaFX runtime error, and after installing with the .msi the application doesn’t run, but when I run it as a Gradle project from IntelliJ, it works.
How to improve the intuitivity
I am using a LINQ style way to write HQL-Queries. There are other solutions but they bring frameworks I do not like to use. Today I have a good working solution that abuse the unicode charset so the sourcecode must be at least UTF8.
My solution is working but I am not sure if this is a good solution for the general public. What to change to the syntax in order to publish it to the public accordingly?
Example: We have two Entities: eMail and eMailSubject. A eMail already exists as an hibernate-entity. The function I present is to programaticaly response to that eMail. The task is to add the "Re: "-prefix to the subject....
can anyone help me understand Object, classes and functions in java?
can anyone help me understand Object, classes and functions in java? I am having a hard time understanding these terms since I am a beginner.
I want to start DSA
Heyy
For here I'm kuro
I recently completed my fundamentals of java n i going to start with dsa soon
So if anyone of you can suggest me any YouTube channel . Can dm me or ping me here.
I would be thankful for that!...
Localization in system
hello guys i need to add localization in my project how should i implement it can anyone guide me?
Spring Boot + Vault Integration Issue
I have an spring boot microservices example. I defined vault running on docker in vm of Google cloud.
Here is the vault dependency of pom.xml in config server
```...
I need help
Hello, so i never coded neither programmed in my life and i want to learn it so i can make a game.
Youtube isnt helpfull really since i never programmed.
If anyone is kind to tutor or help me i eould be gratefull.
-Smokva...
Looking for Advice on Becoming an Elite Java Developer (Currently Beginner)
Hey everyone 👋,
I’m looking for some direction and would really appreciate input from experienced Java Devs.
I’ve been through multiple courses, videos, and resources, but I always hit the same wall: I never stick to one fully because I keep wondering if I’m missing the “holy grail” resource that will actually make me elite. I’ve gone over the basics many times, but I struggle with tying everything together, like when to use what, how it applies in real-world projects, and how to grow beyond just syntax knowledge....
spring-data-r2dbc
Hi, I'm interested if it's possible to configure
ReactiveCrudRepository to have different save(T) then original?yall i need help pls
so i was trying to reinstall discord but it showd me an error. now i have a notepad file i have no idea what to do with it. i cant make calls or whatnot because im using the browser version RN. i really have no idea and i just joined so i can get help. please and thanks
Sealed classes actually need `permits` if are in the same package?
I'm using Java 24. Sealed classes need
permits if they and the inheritors are in the same package? I would to do it without specify the classes in my interface, if it's possible automatically detect the inheritors in the package.
```java
package com.latteIceCream.latte.dto;...