JCH
Java Community | Help. Code. Learn.
We are a Community full of Java developers. You can come here to connect other devs, get help, help others and do many more things!
JoinJCH
Java Community | Help. Code. Learn.
We are a Community full of Java developers. You can come here to connect other devs, get help, help others and do many more things!
Joinwhich IDE should I use for java ?
Eclipse , netbeans , apache netbeans , bluej , intelliJ idea community edition , JDeveloper , JGrasp , Myeclipse, Sublime Text, VS Code (with Java Extensions) , Clojure with Java Support (Cursive) , Codenvy , JCreator, Replit , Xcode , Android Studio vs Kdevelop which editor should I choose for java ? Which one is the best ?
Interfaces for the Service layer
Hello everyone, in the context of backend development, what is the advantage of creating interfaces for the Service layer?
Programming a game
Hey reader. I have programmed several projects in java and wanna take it to a new level (I used BlueJ) . I wanna try programming a little funny pixel game. Any recommendations concerning the Software i can be using? Is Eclipse a good way to do so? Thanks!
Programming a game
Hey reader. I have programmed several projects in java and wanna take it to a new level. I wann try programming a little funny pixel game. Any recommendations concerning the Software i can be using? Is Eclipse a good way to do so? Thanks!
Packing 2 bit numbers into an int.
I have an array of ints where each int represents 16 blocks,
I am attempting to set and read groups of 2 bits within the int as their own numbers, but am getting numbers I did not put in. (ex. i write a 2 in but it gives me a 3 when reading)
This is how I'm setting the values: (key is the new value)
```java
int intPos = pos / 16;...
ThreadPoolTaskExecutor - Configuration way.
Helo, what is the best way to configure ThreadPoolTaskExecutor and why?
1 -
@Bean(name = "thisIsBeanName")
public ThreadPoolTaskExecutor taskExecutor(ThreadProperties threadProperties) {
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
properties..
...unit testing error
I wrote this unit test: ```@WebMvcTest(CustomerController.class)
public class CustomerControllerTest {
@Autowired
private MockMvc mockMvc;
...
git question, not a java question
I have a project on git, and I use github desktop to handle commits and pushes. For some reason, every time I open a branch, including main, it acts like none of my files have been added, and that I created them (when its a team project, and these files have been there for months). Its really tripping me up and making it harder to keep up with files I'm actually supposed to be working on in my branch. Anybody know what this is?
Overwriting a declared method?
Hello, I'm messing with something Java based, I want to modify it a bit. My code is simply this:
...
Method xyzMethod = XYZ.class.getDeclaredMethod("a", int.class, int.class, int.class, int.class, Random.class);
Method xyzMethod = XYZ.class.getDeclaredMethod("a", int.class, int.class, int.class, int.class, Random.class);
Type inference for generic parameters when calling a method
I was making a class with builder-type setters for generic member variables and I noticed something when I tried to pass it to a function accepting an object with a specialized generic argument for that type via new. Mainly this:
```java
public static void bar(Foo<Integer> f){}
public static class Foo<T>{
Foo<T> self(){...
Implementing a third-party PDF rendering library into a java extension
Hi, i'm trying to implement the icepdf library in an extension for a software. When I load the extension I get the following error:
Thanks in advance....
Lombok @Data error
I'm getting this error in this part of code: ```private Customer mapToCustomer(CustomerDto customerDto) throws Exception {
if(customerDto.getFirstName().isEmpty() customerDto.getLastName().isEmpty() customerDto.getEmail().isEmpty() customerDto.getPassword().isEmpty() customerDto.getRole().isEmpty()) {
throw new Exception("All fields must be filled");...
java: cannot find symbol
symbol: method getFirstName()
location: variable customerDto of type dto.CustomerDto
java: cannot find symbol
symbol: method getFirstName()
location: variable customerDto of type dto.CustomerDto
why my spring app cant connect to DB?
hi guys. im using intellij idea to run my java spring app. i connected my db to the intellij idea.
```
host: localhost
port:5432
user:us3r...
someone explain this code (which i mostly understand
public static void main(String[] args) {
int number = 0;
while (true) {
number = number + 1;...
why do i get redirected to /login?
hey guys. i have java spring app. it has this websecurity config chain:
```java
@Override
protected void configure(HttpSecurity http) throws Exception {
http...
Is there a way to optimize my code more?
```java
import java.util.*;
public class Main
{
public static void main(String[] args) {...
javafx.fxml.LoadException
Hello. I use GravitLauncher for minecraft, I compiled my runtime module, but when I try to run it, it gives an error related to the controller (That the class could not be found), I have attached a detailed error below
confused as how to implement stars next to space "∆"
i am doing an assignment where you have to make a right-leaning triangle. However, I am confused as how to make the stars go be placed next to the "∆" (Place holder for " "). I tried using a for loop for the stars where they would supposedly be placed next to the space (∆), however, the output of the stars become jagged and the output overall doesn't look like a right-leaning triangle. Anyone out there who could help?

java/scala multithreading on spark?
I'm using scala spark to get data from hudi table to hive table. I'm already maximizing optimization on spark with worker nodes and cluster size. Table is missing a lot of features that could improve the speed, but it's managed by other team and many other teams are also accessing this table (Thus table side change cannot happen). What I've not tried is multithreading from scala.
Has any of you used java and spark, and applied java multithreading and saw noticeable improvement from data ETL duration?...