I tried to run “eclipse-jee-juno-win32-x86_64″ , but it raised the following error ” java runtime environment JRE or java development kit must be available in order to run eclipse. No java virtual machine was found after searching in the folloiwng location …….. “. Baring in…
Tag: java
Rest Assured – can’t POST with Parameters and Body
I’m testing a REST api using Rest Assured. I’m running into an error when trying to POST with both a parameter in the url and body content. This works correctly when testing manually. Removing the parameter form the url is not an option Test Code: Which throws the following error when run Why does…
Getting location of cell in JXTreeTable
How to determine the location of a particular cell in JXTreeTable on screen? Answer not sure, but merging some information gathered on topic. this link shows the way to compute swing component coordinates: Getting coordinates of a component in java this link shows, that JXTreeTable extends JTable:- this link …
Spring-data-mongodb connect to multiple databases in one Mongo instance
I am using the latest spring-data-mongodb (1.1.0.M2) and the latest Mongo Driver (2.9.0-RC1). I have a situation where I have multiple clients connecting to my application and I want to give each one their own “schema/database” in the same Mongo server. This is not a very difficult task to achieve…
Duplicating objects in Java
I learned that when you modify a variable in Java it doesn’t change the variable it was based on I assumed a similar thing for objects. Consider this class. After I tried this code I got confused. Please explain to me why changing any of the objects affects the other one. I understand that the value of …
ArrayList input java
Im looking at the problem: Write a program which reads a sequence of integers and displays them in ascending order. Im creating an ArrayList (which I am new to) and I want to populate with integers input from the command line. With an array I could use a for loop with but with an ArrayList of unbounded size I…
Very slow debugging in Eclipse
I try to debug Jonas webapp under Eclipse. Unfortunately when I connect to the remote application everything works terriblly slow (also after killing all java applications and restarting the PC). I use also JRebel. What might be the cause of such behaviour? Answer You could also try using the Java Monitoring …
How do I write the exception from printStackTrace() into a text file in Java?
I need to capture the exception in a text file in Java. For example: Using getMessage() works, but it only shows the error message. I want all the information in the printStackTrace() including line numbers. Answer It accepts a PrintStream as a parameter; see the documentation. See also Difference between pri…
Refresh elements of GUI in java
I’m new to GUIs in java. For example, I need to update just 1 element (e.g., JLabel). In Tkinter I would use something like root.update() or root.update_idletasks(). I wonder if a similar simple function exists in for applications made with swing. I’ve tried gui_element.SetVisible(false) and gui_e…
Jackson JSON custom serialization for certain fields
Is there a way using Jackson JSON Processor to do custom field level serialization? For example, I’d like to have the class serialized to the follow JSON: Note that age=25 is encoded as a number while favoriteNumber=123 is encoded as a string. Out of the box Jackson marshalls int to a number. In this ca…