Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged java

38 child tags

Use for questions about Java, a high-level programming language. Consider tagging the question with more specific tags related to the actually used framework (e.g. [spring], [spring-boot], [jakarta-ee], [android], [javafx], [gradle] and [maven]).

This tag doesn't have a detailed wiki yet.

81%
+7 −0
Q&A Why does a lack of object encapsulation constitute a security breach?

In the current version of OpenJDK's JEP 401: Value Classes and Objects (Preview), it is said that value classes can leak data stored in their fields, and that this is potentially a security concern...

2 answers  ·  posted 2y ago by Andreas‭  ·  last activity 2mo ago by roberto almdnde‭

Question java security encapsulation
81%
+7 −0
Q&A How to verify if a year is leap in Java?

How to verify if a year is leap? Given a numeric value (such as 2023) or some object that represents a date (such as Date, Calendar, LocalDate, etc), how can I do it?

1 answer  ·  posted 3y ago by hkotsubo‭  ·  last activity 2mo ago by roberto almdnde‭

Question java date
50%
+1 −1
Q&A JOptionPane doesn't show; application combines Swing and console.

What is wrong in the following code: package oren; import java.util.Scanner; import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { double x,y,z...

1 answer  ·  posted 2mo ago by programAngel‭  ·  edited 2mo ago by FractionalRadix‭

Question java swing Eclipse
57%
+2 −1
Q&A Constant-time modular multiplication library in Java?

Has anyone written a constant-time BigInteger modular multiplication function in Java? I need to use modular multiplication for a cryptographic protocol, and I don't want to try to write it myself ...

1 answer  ·  posted 5mo ago by skye‭  ·  last activity 3mo ago by Alexei‭

Question java
75%
+4 −0
Q&A How to disable ErrorPageFilter in Vaadin Spring boot application when deployed as war?

I am trying to solve a problem with Vaadin 24.9.10 Spring Boot 3.5.11 application deployed as war file for tomcat 10 on my server. There are a lot of error log messages with varying request paths ...

1 answer  ·  posted 4mo ago by MarekChr‭  ·  last activity 4mo ago by MarekChr‭

Question java spring-boot vaadin
60%
+1 −0
Q&A Setting icon with javaFX does not show in task list

I try to set an icon (*.png) with javaFX, but it does not show in the task bar, instead I see the default icon (white cogwheel on light gray background). Here is my code: package application; ...

0 answers  ·  posted 7mo ago by watchmaker‭

Question java linux javafx
71%
+3 −0
Q&A Java: ignore warnings from generated code

Again, I'm playing around with javaCC, and get those annoying warnings about "unused" and "dead code". Is there a decent way to put a @SuppressWarnings annotation on a whole package but not on the...

0 answers  ·  posted 7mo ago by watchmaker‭

Question java code-generation javacc
77%
+5 −0
Q&A java.time.ZonedDateTime missing seconds in output

When printing a java.time.ZonedDateTime, it's missing the seconds in output, is it a bug or a feature? See my code: package tryNcry; import java.time.Instant; import java.time.ZoneId; import...

2 answers  ·  posted 8mo ago by watchmaker‭  ·  edited 8mo ago by watchmaker‭

Question java datetime
75%
+4 −0
Q&A Java generics, how to work around type erasure?

This code doesn't compile: package tryNcry; public class ExampleClass<S extends SomeClass> { S[] createArray(int n) { return new S[n]; // obvious compile time ERROR here: ...

1 answer  ·  posted 9mo ago by watchmaker‭  ·  edited 9mo ago by hkotsubo‭

Question java generics
50%
+0 −0
Q&A Trouble understanding java lambdas and generics

Of course, everyone thinks to understand lambdas and generics. I was one of those until recently. Look at my code: package debug; import java.util.function.Function; public class Understand...

1 answer  ·  posted 9mo ago by watchmaker‭  ·  last activity 9mo ago by r~~‭

Question java
71%
+3 −0
Q&A How to configure launch settings for a Quarkus application using Gradle in Visual Studio Code?

I'm developing a Quarkus application that uses Gradle as the build tool. The application doesn't have a main class. I'm trying to configure a launch setup in VS Code, but looks like something is n...

0 answers  ·  posted 12mo ago by deleted user  ·  last activity 12mo ago by Alexei‭

Question java debugging vs-code quarkus
66%
+2 −0
Q&A How does the GLFW time acquirement function differ from Java’s built-in time getters?

glfwGetTime() and System.nanoTime() both claim to provide precision-based time interval management based on the host platform’s highest resolution and accuracy clock. Naturally, I will only use on...

1 answer  ·  posted 1y ago by Andreas‭  ·  last activity 12mo ago by Monica Cellio‭

Question java lwjgl glfw
57%
+2 −1
Q&A Convert Shaded Java class to its original

How do I cast or convert a shadow/shaded class (a package relocated class which is generally generated via tools like gradle/maven) to its original class in Java? The assumption is that both the s...

1 answer  ·  posted 1y ago by Abbas Gadhia‭  ·  edited 1y ago by Abbas Gadhia‭

Question java
80%
+6 −0
Q&A Java record with final keyword

Although record classes in Java are implicitly final, it's valid to add the final modifier/keyword when declaring a record: final public record Person(String name, String location) {} Does fina...

1 answer  ·  posted 1y ago by Matthias Braun‭  ·  edited 1y ago by Matthias Braun‭

Question java
50%
+0 −0
Q&A Proguard induced : No enum constants for class while deserializing using jackson

I'm getting the following exception with deserializing a json file using jackson. Any tips on how to fix it? com.fasterxml.jackson.databind.JsonMappingException: No enum constants for class com.dp...

1 answer  ·  posted 1y ago by Abbas Gadhia‭  ·  edited 1y ago by Abbas Gadhia‭

Question jackson proguard
60%
+1 −0
Q&A Scanner fails when executing Java with admin rights (sudo) in Eclipse in Linux

(Brought over from SE.) The problem I have followed this procedure in order to run Java applications as root when needed from Eclipse (as I use Xubuntu, for instance, when using jnetpcap to cap...

1 answer  ·  posted 1y ago by aura-lsprog-86‭  ·  edited 1y ago by aura-lsprog-86‭

Question java linux Eclipse sudo jnetpcap
60%
+1 −0
Q&A How can I set a private class instance variable to the File object used by an unmarshaller?

(Brought over from SE) The problem I'm coding a Java Swing application dealing with XML files, so I'm using JAXB in order to marshal classes into documents and unmarshal the other way around. ...

1 answer  ·  posted 1y ago by aura-lsprog-86‭  ·  last activity 1y ago by aura-lsprog-86‭

Question java event-handling callback jaxb
60%
+1 −0
Q&A How to do function composition in Spring Cloud Stream when using classes

I'm working on a proof of concept for a Spring Cloud Stream application. I want to define my processing logic using classes that implement Function, Consumer, or Supplier. I understand that Spring...

0 answers  ·  posted 1y ago by deleted user  ·  last activity 1y ago by Monica Cellio‭

Question spring-boot spring-cloud spring-cloud-stream
66%
+2 −0
Q&A Unable to configure enhanced route discovery in Apache Camel

I'm currently working with Apache Camel in a Quarkus application. I would like to configure the application to not discover any routes by default, and only include those defined in specific package...

0 answers  ·  posted 1y ago by deleted user  ·  edited 1y ago by Alexei‭

Question java quarkus apache-camel enterprise-integration-patterns
50%
+1 −1
Q&A How can I properly implement Hexagonal Architecture and Domain Driven Design in the same application?

I'm trying to use the "hexagonal architecture" and "domain-driven design" paradigms together, in a Java application using Spring. I understand that my application should have a structure with 3 la...

1 answer  ·  posted 2y ago by rudahee‭  ·  edited 1y ago by Karl Knechtel‭

Question java spring hexagonal-architecture domain-driven-design
66%
+2 −0
Q&A LocalDate format in fields stored as json via Hibernate

Setup I have a database table with field of JSONB type. I access said database using Hibernate. In hibernate I have entity mapped on said table. Entity contains field marked with @JdbcTypeCode(...

1 answer  ·  posted 1y ago by talex‭  ·  last activity 1y ago by talex‭

Question java json spring hibernate
66%
+2 −0
Q&A Multiple versions of scala libraries detected!

While compiling my scala project I'm getting following error. org.scala-lang.modules:scala-parser-combinators_2.13:2.4.0 requires scala version: 2.13.13 org.scalatest:scalatest_2.13:3.2.19 requ...

0 answers  ·  posted 2y ago by talex‭

Question maven scala
77%
+5 −0
Q&A Json deserialization of enum, forbid int

I have a DTO that contains an enum field: @Getter @Setter static class Foo { Bar bar; } enum Bar { X, Y } When I deserialize a JSON, it allows int as values: var objectMapper ...

2 answers  ·  posted 2y ago by talex‭  ·  edited 2y ago by hkotsubo‭

Question java json jackson
66%
+2 −0
Q&A SQL scripts referenced in persistence configuration must have each statement on its own line

I'm currently working on a Java application using Jakarta Persistence with EclipseLink and PostgreSQL. While setting up the application to test the database layer, the persistence configuration is ...

0 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by deleted user

Question java sql jpa jakarta-ee jakarta-persistence
84%
+9 −0
Q&A Map, Optional> to Map, T>

I have a Map with Optional values. I want to filter it to remove empty values. Map<K, Optional<T>> input; Map<K, T> result = input. // here is some code I'm looking for ...

2 answers  ·  posted 2y ago by talex‭  ·  last activity 2y ago by hkotsubo‭

Question java stream
71%
+3 −0
Q&A Prevent anonymously subclassing

Is it possible to somehow prohibit anonymously subclassing of a specific class? For instance, with a plain public parent class: public class Parent { } Extending this class should not be pos...

1 answer  ·  posted 2y ago by Andreas‭  ·  last activity 2y ago by Antares‭

Question java inheritance
66%
+2 −0
Q&A Spring Boot application not excluding Jdbi bean when running tests using WebFluxTest

I have a simple Spring Boot 3.x reactive application that exposes a RESTful API. The application uses Jdbi in the persistence layer, and the configuration for Jdbi is straightforward: @EnableTrans...

0 answers  ·  posted 2y ago by deleted user

Question java spring spring-boot jdbi
66%
+2 −0
Q&A Maven JPA integration: processor not found

My annotation processor "cannot be found" but everything ~looks okay. In Eclipse IDE, I created a new Maven project with the "quickstart-architype" resulting in a project with this structure: ___...

1 answer  ·  posted 2y ago by tylerbakeman‭  ·  edited 2y ago by Andreas‭

Question java xml jpa
66%
+2 −0
Q&A Maven exec:exec fails to see executables

I am stumped at Maven exec plugin. Running mvn exec:exec -Dexec.executable="curl" (or "echo") works. But when running mvn exec:exec or mvn exec:exec@b (or @a) it fails saying The parameter 'exe...

1 answer  ·  posted 3y ago by LAFK‭  ·  last activity 2y ago by mirabilos‭

Question maven maven-exec-plugin
60%
+1 −0
Q&A ServletContext matched by more than 1 path

The javadoc for ServletContext.getContextPath() says that It is possible that a servlet container may match a context by more than one context path. I was trying to find any explanation how t...

0 answers  ·  posted 2y ago by morgwai‭

Question java servlets jakarta-ee
77%
+5 −0
Q&A How can one import two classes with the same name in Java8?

Some development tools provide an error message when a user tries to import two things (classes, packages) with the same name. Some programming languages offer a syntax to import one of those thing...

2 answers  ·  posted 2y ago by tarhalda‭  ·  last activity 2y ago by Michael‭

Question java java-8
40%
+0 −1
Q&A Eclipse Custom Errors for Annotation Processing

In Eclipse, is it possible to setup custom errors or markers in the editor, for annotation processing? For example, the standard squiggly lines with descriptions. This question is not important. ...

0 answers  ·  posted 2y ago by tylerbakeman‭

Question java jpa Eclipse
60%
+1 −0
Q&A How to log first n lines of a stack trace in Java?

How to log first n lines of a stack trace in Java?

2 answers  ·  posted 2y ago by propatience‭  ·  last activity 2y ago by hkotsubo‭

Question java logging stacktrace
60%
+1 −0
Q&A MongoDB Java Morphia case insensitive criteria query?

So I googled some on how to make a case insensitive criteria query but could not find the solution very easily. So I basically have code that looks like this: ... query.criteria("fieldName").con...

1 answer  ·  posted 2y ago by propatience‭  ·  edited 2y ago by propatience‭

Question java mongodb morphia case-insensitive
66%
+2 −0
Q&A What is the purpose of having a wrapper class for JarFile in Spring-boot-loader?

My question relates to Spring-boot-loader v2.6.15. For the purposes of this question, I will refer to Spring's custom JarFile class as CustomJarFile to avoid confusion. Context I am reusing so...

1 answer  ·  posted 2y ago by Miss Skooter‭  ·  last activity 2y ago by Miss Skooter‭

Question java spring spring-boot
66%
+2 −0
Q&A Escape both reserved characters and curly braces in a URI in Spring Boot

I need to pass URI's that contain special characters, using Spring Boot. The characters include spaces, curly braces ({ and }), square brackets ([ and ]), and hash signs (#). The problem is that ...

1 answer  ·  posted 2y ago by FractionalRadix‭  ·  last activity 2y ago by FractionalRadix‭

Question spring-boot escaping uri
50%
+1 −1
Q&A How do I properly render a quad in OpenGL using a GL_TRIANGLE_STRIP primitive?

I am currently working with LWJGL and the obstacle I face right now on my project is rendering textures to a cube, e.x a set of 8 vertices with position, color, and UV information. For now, I am st...

1 answer  ·  posted 3y ago by cuzzo‭  ·  last activity 3y ago by djm‭

Question java game-development graphics OpenGL lwjgl
71%
+3 −0
Q&A Clear selectManyMenu component if user unselects item in JSF 2

I am working with JSF 2.3 and have a selectManyMenu component that is marked as required but that I want to be cleared if the user unselects all items. Currently, the user can unselect all items, b...

1 answer  ·  posted 3y ago by tarhalda‭  ·  edited 3y ago by BalusC‭

Question java ajax jsf selectmanymenu
66%
+4 −1
Q&A How do I remove an element from a Java array?

One way to remove element from array is to replace element with zero. Below is a rough snippet I am sharing: int N = sc.nextInt(); int pos = sc.nextInt(); int A[] = new int[N]; if(pos == i) { ...

1 answer  ·  posted 3y ago by abhinavxyz‭  ·  edited 3y ago by E_net4‭

Question java array
60%
+1 −0
Q&A How to put text next to my ImageIcon on a cell in a JTable

I have an application that works with a JTable, and in this JTable, I want each cell to have both an ImageIcon and some text. I see at this link, JTable supports ImageIcon OR text, but seemingly n...

1 answer  ·  posted 3y ago by davidalayachew‭  ·  edited 3y ago by Alexei‭

Question java swing JLabel ImageIcon
77%
+5 −0
Q&A How to trigger an error/warning immediately upon compile/run if an item on my class-path is missing

I have a very simple source file -- HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("hello world"); } } I have th...

0 answers  ·  posted 3y ago by davidalayachew‭  ·  edited 3y ago by davidalayachew‭

Question java compiler-errors compiler-warnings javac classpath
66%
+2 −0
Q&A Log4j2 not looking for log4j.properties even with the system property set

I am migrating an application from Log4j1 to Log4j2 using the API bridge jar. All references to the log4j1.jar have already been removed. I set the system property in Websphere as a JVM argument -...

1 answer  ·  posted 3y ago by tarhalda‭  ·  edited 3y ago by Alexei‭

Question java log4j
71%
+3 −0
Q&A Running mvn validate does not show rules passed message though it should

My large, multi-module Maven project validation (Maven Enforcer plug-in) is playing tricks on me. moduleA> mvn validate correctly finds all modules runs enforcer on all of them displays co...

0 answers  ·  posted 3y ago by LAFK‭

Question maven maven-enforcer-plugin
75%
+4 −0
Q&A DocuSign eSignature API SDK: java.lang.NoClassDefFoundError errors.

I am trying to implement DocuSign's eSignature REST API by using Java SDK. I am following instructions here: https://developers.docusign.com/docs/esign-rest-api/sdks/java/setup-and-configuration/ ...

1 answer  ·  posted 3y ago by Vanity Slug ❤️‭  ·  last activity 3y ago by Vanity Slug ❤️‭

Question java sdk docusignapi maven
77%
+5 −0
Q&A Is it worth using the Java Platform Module System in application code?

Is it worth using the Java Platform Module System introduced in Java 9 to structure application code? Given that the Java Platform Module System introduced in Java 9 doesn't manage dependency vers...

1 answer  ·  posted 5y ago by meriton‭  ·  edited 3y ago by __blackjack__‭

Question java architecture
50%
+1 −1
Q&A Rest service doesn't find @GET Method (Jersey Rest service in Gradle).

I have to implement a JSON based REST web service for querying literature. Ordinary users should be able to query data and process it in their clients. The "main user" can adapt database entries vi...

0 answers  ·  posted 3y ago by Gagamelius‭  ·  edited 3y ago by Alexei‭

Question java json rest gradle jersey
55%
+3 −2
Q&A How to proportionally convert a number in the range of -1 and 1 to a number in the range of 0 and 319

I have float noise values, between -1 and 1, for every x,y coordinate in a 2D area and I am trying to convert that to a whole number between 0 and 319 which represents a vertical z coordinate to re...

3 answers  ·  posted 3y ago by cuzzo‭  ·  last activity 3y ago by Dirk Herrmann‭

Question java 3d math
66%
+2 −0
Q&A How would I avoid textures being blurred when mapped to a TriangleMesh?

I am making a game using JavaFX and the Fxyz library. I have chunks which are made of Point3D's, these points are then passed to a ScatterMesh and that is used to generate a TriangleMesh so I can m...

0 answers  ·  posted 3y ago by cuzzo‭  ·  edited 3y ago by Alexei‭

Question java 3d javafx fxyz3d
33%
+0 −2
Q&A Deep linking from another app isn't working for Amazon prime and disney+hotstar

It's not possible to send data to amazon prime and disney+hotstar. I was trying to send user to amazon prime when they click a (video) link (e.g. https://www.amazon.com/gp/video/detail/B01MSPI8JN/r...

1 answer  ·  posted 3y ago by billy‭  ·  last activity 3y ago by billy‭

Question java android deep-linking
28%
+0 −3
Q&A How would I go about chunk loading around player in a 3 dimensional cartesian coordinate space [closed]

So I am in the process of creating a voxel sandbox survival game (minecraft clone) in javaFX. I am at a point where I need to come up with a way to load the chunks in my surrounding given a render ...

1 answer  ·  posted 3y ago by cuzzo‭  ·  closed 3y ago by cuzzo‭

Question java javafx