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

23 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.

60%
+1 −0
Q&A Maven JPA integration: processor not found

Personal Project: I am new to Maven and have spent a few weeks troubleshooting pom errors with chatGPT. Tutorials are hard to come by online, because annotation-processing in Java is more complica...

2 answers  ·  posted 1d ago by tylerbakeman‭  ·  last activity 12h ago by Zer0‭

Question java xml jpa
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 29d ago by propatience‭  ·  last activity 28d ago by hkotsubo‭

75%
+4 −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...

1 answer  ·  posted 2mo ago by tarhalda‭  ·  last activity 1mo ago by tmpod‭

Question java java-8
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 2mo ago by propatience‭  ·  edited 2mo ago by propatience‭

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 2mo ago by Miss Skooter‭  ·  last activity 2mo ago by Miss Skooter‭

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 5mo ago by FractionalRadix‭  ·  last activity 5mo ago by FractionalRadix‭

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 6mo ago by cuzzo‭  ·  last activity 6mo ago by djm‭

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 9mo ago by tarhalda‭  ·  edited 6mo ago by BalusC‭

62%
+3 −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 6mo ago by abhinavxyz‭  ·  edited 6mo 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 7mo ago by davidalayachew‭  ·  edited 7mo ago by Alexei‭

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 7mo ago by davidalayachew‭  ·  edited 7mo ago by davidalayachew‭

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 8mo ago by tarhalda‭  ·  edited 8mo ago by Alexei‭

Question java log4j
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...

0 answers  ·  posted 8mo ago by LAFK‭

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 9mo ago by LAFK‭

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 10mo ago by Vanity Slug ❤️‭  ·  last activity 9mo ago by Vanity Slug ❤️‭

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 3y ago by meriton‭  ·  edited 10mo ago by __blackjack__‭

Question java architecture
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 1y ago by hkotsubo‭  ·  last activity 1y ago by hkotsubo‭

Question java date
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 1y ago by Gagamelius‭  ·  edited 1y ago by Alexei‭

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 1y ago by cuzzo‭  ·  last activity 1y 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 1y ago by cuzzo‭  ·  edited 1y 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 1y ago by billy‭  ·  last activity 1y ago by billy‭

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 1y ago by cuzzo‭  ·  closed 1y ago by cuzzo‭

Question java javafx
66%
+2 −0
Q&A Why is IntelliJ not finding these modules?

So to preface I started a new JavaFX project in IntelliJ and all of this is from what was auto-generated out of the box. The modules I'm having trouble with are Edit to make this post more query...

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

Question java intellij-idea
37%
+1 −3
Q&A Java cannot find class within same package

I've written a class object, QueueObject, but when I try to construct it inside of my main class, it says it cannot find the symbol on compilation. I've read lots of pages saying how misspellings o...

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

Question java class
42%
+1 −2
Q&A How to solve missing JAR files error from Ant

I keep getting this error: Cause: the class org.apache.tools.ant.taskdefs.optional.ssh.SSHExec was not found. This looks like one of Ant's optional components. Action: Check that the ap...

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

Question linux jenkins ant jar
77%
+5 −0
Q&A How to open a file and edit its content in groovy script

I have a Makefile in my Jenkins job's workspace, that I want to edit out certain parts from and then save it, before running next part of the script that uses this Makefile. The part that I want t...

2 answers  ·  posted 2y ago by Megan‭  ·  last activity 2y ago by Alexei‭

Question jenkins shell groovy
75%
+7 −1
Q&A How to avoid "exception is never thrown" when commenting out a line while debugging

I have a code block like this: try { ... x.foo(); // This is the line that forces us to have the try block ... } catch (ArrayIndexOutOfBoundsException e) { logger.error(e.getM...

1 answer  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by anatolyg‭

Question java exception
57%
+2 −1
Q&A How can the Caesar cipher be implemented in Java?

The Caesar cipher is a substitution cipher in which the letters of an ordered alphabet are cyclically shifted by a given number. A detailed description can be found e.g. here. Let u be the index o...

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

37%
+1 −3
Q&A Mocking methods with arguments

Let's say I have this class I want to mock class A { public void add(T arg) { B b = A.getB(); U val = somefunc(arg); V ret = b.add(val); } } I have a spy o...

3 answers  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by klutt‭

42%
+1 −2
Q&A How to create an object, call one of it's methods and pass it as an argument as a oneliner?

Assume I have this class Foo class Foo { private int x; void setX(int x) { this.x = x; } } And I have a Junit test like this: Bar bar; @BeforeEach void setu...

3 answers  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by Alexei‭

Question java junit
72%
+6 −1
Q&A How to unittest method that involves contacting remote servers?

Let's say I have this class: class myService { private boolean foo(T arg) { return arg == 42; } public Response bar(U arg) { if(foo(U.field)) { return Response.st...

1 answer  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by meriton‭

66%
+2 −0
Q&A How to check if a ldap username is valid without contacting the active directory via ldap?

I have some code connecting to an active directory via ldap. Something like this: public Response add(User user) { try { LDAPConnectionPool ldapPool = ldapConnectionPool.getPool();...

0 answers  ·  posted 2y ago by klutt‭  ·  edited 2y ago by klutt‭

40%
+2 −4
Q&A How do I properly format a String for parsing with a com.google.gson.JsonParser

I am trying to check a JSON array for a certain element. However, when I try to instantiate a JsonElement to search the list for: JsonElement builderElement = JsonParser.parseString( "{\"disc...

0 answers  ·  posted 2y ago by cuzzo‭  ·  edited 2y ago by Stephen C‭

Question java json json-parser
77%
+5 −0
Q&A How to prevent token from being refreshed

I have an Angular application. The frontend has a mechanism that periodically fetches some information like this: ngOnInit(): void { setInterval( () => { this.http.get(... ).sub...

1 answer  ·  posted 2y ago by klutt‭  ·  last activity 2y ago by meriton‭

37%
+1 −3
Q&A Cannot write multipart message to byte array [closed]

I'm trying to write a MIME message to the console. ByteArrayOutputStream out = new ByteArrayOutputStream(); MimeMultipart replyMsg = mdnCreator.createMDNData(); replyMsg.writeTo(out); out.close...

0 answers  ·  posted 2y ago by artaxerxe‭  ·  closed 2y ago by Alexei‭

62%
+3 −1
Q&A java.lang.UnsupportedClassVersionError: when trying to connect to JDBC with JDK 14 in Eclipse

I'm trying to connect to a db file in my project but having some troubles. I'm using JDK 14 with ojdbc11 however I am still getting this when trying to connect: java.lang.UnsupportedClassVersionEr...

1 answer  ·  posted 2y ago by cuzzo‭  ·  edited 2y ago by Alexei‭

53%
+5 −4
Q&A What's the difference between Inheritance and Polymorphism?

I'm using Java code as an example, but this can be answered if you don't know Java. class Bird{ public void sing(){ System.out.println("Testing"); } } class anClass ex...

2 answers  ·  posted 2y ago by deleted user  ·  edited 2y ago by Alexei‭

57%
+2 −1
Q&A Hash sum mismatch (only for openjdk-11-jdk)

I was installing Java yesterday. I had faced lot of problem. I had fixed most of them. But I had changed Hash that's what I think. I don't remember which command I had executed since I had executed...

1 answer  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Alexei‭

22%
+0 −5
Q&A Why I am unable to find a class after implementing library also?

I had found a better way to plot in Java. int n = Integer.parseInt(args[0]); // the function y = sin(4x) + sin(20x), sampled at n+1 points // between x = 0 and x = pi ...

0 answers  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Anonymous‭

Question java package
50%
+0 −0
Q&A Why some items aren't clickable in RecyclerView?

if (type=="dialer") { String timestamp = list.get(position).get(Constants.DATE); holder.txtTimestamp.setVisibility(View.VISIBLE); holder.imgDelete.s...

0 answers  ·  posted 2y ago by Anonymous‭

60%
+1 −0
Q&A WARNING: environment variable DISPLAY is not set (netbeans)

I was trying to install Netbeans in Xubuntu. I had installed Netbeans using Snapd. sudo snap install netbeans --classic I was trying to start Netbeans then I got an error which was looking like...

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

60%
+1 −0
Q&A Why is the switch statement not executing the correct case blocks?

In the code below, the value of order variable should change according to i's value: String order; switch (i){ case 0: order = CallLog.Calls.DATE + " DESC "; contactViewAda...

1 answer  ·  posted 2y ago by Anonymous‭  ·  last activity 2y ago by hkotsubo‭

36%
+2 −5
Q&A What are the disadvantages of using static methods in Java?

I was using static method few moments ago. But I noticed that I was returning a variable using that static method. According to the article, Static is a keyword that identifies the class-related...

4 answers  ·  posted 2y ago by Anonymous‭  ·  last activity 2y ago by hkotsubo‭

Question java static class
57%
+2 −1
Q&A What's the minimum API level for activity transition?

I was trying to show transition on activity changes. I had followed two method from SO. I lost those link so I can't add them here. My first method was I had used overridePendingTransition on onCr...

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

50%
+0 −0
Q&A What should I use instead of managedQuery?

managedQuery is recently deprecated. ManagedQuery was used for using Cursor. What should I use since managedQuery was deprecated? Without it, I can't work with Cursor. So there must be alternative ...

1 answer  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Alexei‭

60%
+1 −0
Q&A Why ArrayList is always same value in only Adapter?

This is the worst bug I have ever seen.. I was fetching CallLogs following way. ArrayList<HashMap<String, String>> callLog= new ArrayList<>(); HashMap<String, Strin...

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

60%
+1 −0
Q&A event_start always returning contact number in android

Why ContactsContract.CommonDataKinds.Event.START_DATE always returning contact number. The number is available in Google Contacts. Here what I am doing... Cursor c; if (contactID==""...

0 answers  ·  posted 2y ago by Anonymous‭

50%
+0 −0
Q&A What's the alternative of "ContactsContract.Contacts.LAST_TIME_CONTACTED"?

What should I use instead of ContactsContract.Contacts.LAST_TIME_CONTACTED? According to documentation, LAST_TIME_CONTACTED variable was deprecated. Even it was written in ContactsContract.class /...

0 answers  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Anonymous‭

60%
+1 −0
Q&A Find image for contact list in Android Java

How to get image of contact list? I was using cursor to get contact list. Here how it looks like. ArrayList<HashMap<String, String>> contactList = new ArrayList<>(); Has...

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

80%
+6 −0
Q&A Proper way of sending large amount of data from View to ViewModel

The problem I am working on a simple drawing app for Android. I have a custom view on which the user can draw. This means that a lot of data (a list of points) is generated in this View. I want t...

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

Question java android binding