Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

With more than 20,000 members, join one of the biggest and most active Java Communities on Discord! ☕

Join

java-help

❓︱qotw-answers

Good source to study threading for newer JDK releases(17 and greater)

dev.java does not seem to have a page for threading, can someone please suggest me a source for it for newer JDK version(17 and greater)?

I am trying to create a simple java project Student Management System

I have a problem in compiling 2 java files I can't seem to connect them both. Those 2 java files are under the same folder
No description

Regarding career growth in java

Hello folks , I am Sriram and i have been practicing java since 2 years. Now i am at my finaly year of college. I have passion in java development and started Spring boot. I thought Cloud Java Full Stack developer is a good option for me. But now, i am so much confused about the job market today . I need to find the right path which focus both growth and future scopes. So please suggest me Is the options is worth and what i need to do to get there (Cloud Java Full Stack Developer).

IntelliJ or Visual Studio Supporting Java

How do I make Visual Studio/IntelliJ support java, like I can run the code and the terminal shows up. and contain Auto Complete, etc.

Career Options In java

Hello folks , I am Sriram and i have been practicing java since 2 years. Now i am at my finaly year of college. I have passion in java development and started Spring boot. I thought Cloud Java Full Stack developer is a good option for me. But now, i am so much confused about the job market today . I need to find the right path which focus both growth and future scopes. So please suggest me Is the options is worth and what i need to do to get there (Cloud Java Full Stack Developer).

Error in remove Node method in Java

```java public boolean removeNode(int key) throws Exception { AVLNode parent = null; AVLNode current = root; AVLNode newSubRoot = null; while (current != null) { int cmp = Integer.compare(current.key, key);...
No description

Hey guys,

I am trying to sort a String Array by the length of it's elements. I found only this solution: Arrays.sort(strs, Comparator.comparing(String::length)). Is there a more 'elegant' way to do it (strs is the name of the Array)?

Spring Boot SAML2 with Microsoft ADFS

Hello everyone, I have a problem with Spring Boot SAML2 with MS ADFS. It seems everything is working fine, but after a while the request will be too long and I get an error with message: Header field too long. I've realised that in the header more saml cookie are created over time. After every call of ADFS, SamlSession cookie size increasing a bit. What cause this size increasing and how can I solve this problem?...
No description

LWJGL missing EGL .dll

I hope someone here can help me with this. I just tried to add EGL to my game (for shared contexts), and it can't find the egl .dll file. Build.gradle: ``` val lwjglVersion = "3.3.3" val jomlVersion = "1.10.7" ...

VSCode and RedHat Java: wrong JDK for gradle tasks

Dear community, I've installed OpenJDK 21. I have configured JAVA_HOME and JDK_HOME accordingly, setup the JDK Runtime under Project Settings (JavaSE-21, which correctly points to the Eclipse Adoptium's jdk 21 folder). The build.gradle file is configured to run with Java version 21 (see following config). I have no clue why, when I start the Gradle tasks via the Gradle integration tab, it uses the java.exe included in the redhat's extension (java v. 17). Running gradlew from the shell, it works correctly (i.e. .\gradlew.bat init)...

Math in Java. What a struggle. Help. Please. Fast.

I am solving complicated mathproblems in an application that solves highly sophisticated geometrical tasks. Now i am struggeling, because I have to solve the following term to get the two x-values for zero. Is there some kind of util I can use to solve this?
0=x^2+-2*x*a+a^2+((R^2-r^2-c^2-d^2+a^2+b^2+-x*(-2*c+2*a))/(-2*d+2*b))^2+-2*b*((R^2-r^2-c^2-d^2+a^2+b^2+-x*(-2*c+2*a))/(-2*d+2*b))+b^2
0=x^2+-2*x*a+a^2+((R^2-r^2-c^2-d^2+a^2+b^2+-x*(-2*c+2*a))/(-2*d+2*b))^2+-2*b*((R^2-r^2-c^2-d^2+a^2+b^2+-x*(-2*c+2*a))/(-2*d+2*b))+b^2
...

Pls help. No operator is defined in streaming topology. Cannot execute.

So my task is to set up a Apache flink in my Linux Ubuntu wherein I should be having two data bases as postgress and MySQL . The 2 data bases should be connected in such a way that any change or update in my postgres database should I immediately reflect in my SQL database. But this is error I'm encountering while running my flink job. Pls help guys. I've some error in Java code only.....

Spring sessions with Redis

Hi, I have these 2 endpoints: ```java @GetMapping("/signin") public ResponseEntity<String> signIn(@RequestParam String username, @RequestParam String password) { var auth = authenticationManager.authenticate(new UsernamePasswordAuthenticationToken(username, password));...

I want to learn Springboot and webflux, need best resources recommendation

As said in the title, i have some idea about basic java, and i tried reading "hands on reactive programming in spirng 5" but i was lost. Someone told me i could jump into springboot, rather than learn spring first. If someone could help me with how i should proceed and which resources to use, that would be great. Thanks!

Two Sum Problem on leetcode

Hi guys, I can't seem to figure out what the problem is here: class Solution { public int[] twoSum(int[] nums, int target) { ...

Study guide

Hello, Im a 4th year cs student, I'm good in ds and algorithms, OOP and java core. So my question is can i start with spring boot now or is there any requirements i should learn before?...

ResponseEntity incorrectly maps values

I have two entities: Product and Variant. Each product has a set of Variant. To get a product, I have a controller endpoint: http://localhost:8081/api/products/{id} Hence to call a product, I'll have to call this endpoint: ``` @GetMapping("{productId}")...
No description

JSON Schema Validator with message option

Hi People, I'm using Katalon for test design and i need to validate a json response against an schema, but most of the ones i've found doesn't allow me to set a custom error message in case any specific part of the schema fails the validation. The question is, is there any java json schema validator that works with java 8 and allows me to set custom error messages to the schema parts ? ...

Flow chart to Java.

Hello! I was given a flow chart with no instructions on how to turn it to code. It's meant to be super basic because all we have really learned are scanners, strings, while, if, those kinds of things. I have been working on this for almost two days and keep striking out. I have included a screenshot of what I have figured out to so far.
No description
Next