Fork me on GitHub
#java
<
2024-01-16
>
Drew Verlee03:01:08

If i want to partition my lazy list into subsists by subsist size, i assume my options are a for loop which creates sublists based on the size of the current sublist compared against the max sub-list size or a stream which does the same only i have to likely write a custom accumulator or something. Should i just use a loop then? Is that a principle difference between the two abstractions or does it just seem simpler because i haven't written a custom accumulator before. For brevity (or possible as a distraction since i'm not sure i can enable this on my project), their are also https://download.java.net/java/early_access/jdk22/docs/api/java.base/java/util/stream/Gatherer.html which look like streaming "windows" to me.

stopa14:01:31

Hey team, noob java question. My nephew asked me the following: His school computers are on java 1.8, which can't run the jar that he is building. Is there some tool that can "pre-package" whatever java runtime is needed for his jar?

dharrigan15:01:18

Can you elaborate a bit more on what you mean by "cannot run the jar he is building"

dharrigan15:01:27

How is he attempting to run it?

stopa15:01:14

What he says: He goes to the school's windows computer, and double-clicks the jar file. I would imagine this just runs the equivalent of java -jar The reason he can't run it, paraphrased from his words: The UI Library he is using looks much worse when run with java 1.8. He also uses lambda expressions, which don't work in 1.8

dharrigan15:01:15

I believe lambda's came in java 1.8

dharrigan15:01:31

In terms of running it, it depends on what the OS is set to do on double click of the file. Is there any way he can open up a terminal/command prompt and do java -jar myjar.jar and see what the output is?

dharrigan15:01:09

And what UI library is he using? (Re-reading your reply, it seems he can run it, otherwise, how would he know that the UI library looks worse?)

👍 1
stopa15:01:09

Okay, I think he may have been a bit confused. He thought java 8 and java 1.8 were different versions. Looks like yes lambda expressions are supported, and FlatLaf (his UI library) supports java 8 too. I guess he had a previous project and developed some intuition that he hasn't tested. Thanks @U11EL3P9U 🙂 Will tell him to go to school and actually try running the jar

dharrigan15:01:09

I'm happy to help and I hope he manages to succeed 🙂

❤️ 1