I am using However when executing sbt assembly I am getting: running java 18 Answer Using java 8 solved this issue as AminMal suggested
Tag: java
How to practise coding in java with eclipse without creating a new class each time
I am learning java. while i was learning C++ i used to copy codes from tutorial to code::block and play with it. but in java with eclipse i have to create a new class each time, so that it matches the code. is there a way so that i could copy past the code in eclipse and run it without
Hibernate 5 and JPA: select table without his children but maintain persistence on save
I have two models: Ordine and DettaglioOrdine. I would like that, when I save an object of type “Ordine”, hibernate also save his child “DettaglioOrdine” (and this works). But, if I do a select query, the query is very very slow because hibernate retrieve also DettaglioOrdine. So, I wo…
In Java, how do you deal with double quote inside of a CSV that you need to parse
here is what I want to do, This my spend.csv file : From a table view : Table View of the csv And here is what I want as my output file named spend.xml : In order to do that, I found some stuff here and there and managed to get this : At this point the programm should print
Best practice: weak reference to activity in static method
I need to reference an activity in several static methods. I’m curious to know the best practices to avoid memory leaks. Let’s use examples: Example 1: Example 2: So three questions: Do example 1 or 2 make any difference? I haven’t seen methods being called this way much outside of subclasse…
Can’t automatically obtain ID for a record in database
My entity is: Method to write a record to the database. I just want to send it to the database and automatically obtain an ID for every record in this table, but every time when I do this – “status”: 500, “error”: “Internal Server Error”. And nothing changing in table…
Check if items in List match with String attribute in list of objects
Let’s say I have a list of names: On the other hand, I have a list of people: Person has name and age attributes. From the first list of names, I need to know what names are not present as names in the list of people. This is my attempt: I wonder if there is a better approach, a more
Spring cloud stream merge responses from two different functions
I’m trying to use spring cloud stream to solve the following problem: I have a class that calls two separated functions (Function A and B), both of those functions must work in parallel if the Function A finishes it must call the Function C, the same happens if Function B finish but this will call Funct…
hava regex starts with and ends with and skipping a specific charachter
I would like to find a string that starts and ends with a specific special character but skipping when another specific charachter. I want to find any string that starts with “hello”and ends with a dot “.” but not like “here end.” this must be skipped when “here end&#…
why can’t I add chars to a new string?
code: The second line is wrong for some reason and I don’t know why Answer The book is wrong, and Eclipse is right. In Java, you can write “abc” + whatever, or whatever + “abc”, and it concatenates the strings — because one side is a String. But in st.charAt(0)+st.charAt(st…