Questions Tagged [Java-8]
Ask Question Use This Tag for Questions Specific to Java 8 Which Is Version 8 (Internal Number 1.8) of the Java Platform, Released on 18 March 2014. in Most...
Use this tag for questions specific to Java 8 which is version 8 (internal number 1.8) of the Java platform, released on 18 March 2014. In most cases, you should also specify the java tag.
Must Read
22,386
questions
-1
votes
0
answers
13
views
ScheduledExecutorService not working with parameters
I am trying to run a scheduled job using scheduledexecutorservice interface. It is working when a create a runnable task but it is jot working when I am trying to call a method which returns Runnable.
...
2
votes
1
answer
39
views
How to convert from long+TimeUnit to Duration?
I'm migrating some signatures from f(long dur, TimeUnit timeUnit) to f(Duration duration), and would like to implement the former with the latter.
Being on Java 8, I can't find any API to easily ...
0
votes
0
answers
13
views
Combine lists of 2 different objects into list of single object using Java 8 Stream API
I have two lists as below:
List ids = Arrays.asList(1,2,3);
List reps = Arrays.asList("abc","pqr","xyz");
Now I want to create list of Prediction objects with values ...
2
votes
1
answer
34
views
Standalone Nashorn with Java 11 throws java.lang.StackOverflowError upon eval
I came across an issue with Nashorn, when evaluating a large expression, it works fine in Java 8 , but throws a java.lang.StackOverflowError in Java 11.
Exception in thread "main" java....
-1
votes
0
answers
27
views
Future of a byte array deserialization in Java 8 [closed]
I have an async network call to be made. I have seen two approaches of achieving the same.
public Future<byte[]> getRepsonse(Request request){
Future<byte[]> repsonseBytesFuture = ...
0
votes
0
answers
28
views
When LockSupport.unpark() occur before LockSupport.park() , It would block in the park() method in the follow code, Why?
In javadoc , LockSupport.unpark() can occur before LockSupport.park() and guaranteed that next call to park is not to block.
Makes available the permit for the given thread, if it was not already
...
0
votes
1
answer
33
views
How to extract the instance value in the string efficently
I have a string "/p4products/nemis2/filehandlerU/encdv2/work/10098325" which is coming as input from CMD.
In this string the "encdv" is the environment name and "2" is ...
-1
votes
0
answers
23
views
Load java agent in java 8
I am trying to load a javaagent in java 8, in higher versions (9+) there is the VirtualMachine class but in java 8 it does not exist, I have read that this class exists in the tools.jar and can be ...
0
votes
0
answers
49
views
why char[1024] shallow size is 2072
Here is a char array with length 1024. I dump Java program run in Java8 into a hprof file. I find the size of char[1024] is 2072.
In my opinion, empty char array takes header(8 bytes) plus reference(4 ...
-1
votes
0
answers
17
views
configuring java 8, spring boot and webflux with oracle database
is it possible to use java 8 spring boot with webflux, database and oracle?
I'm using spring-boot version 2.2.10, java 8
example of my pom
<dependency>
<groupId>org.springframework....
0
votes
0
answers
16
views
+50
hierynomus smbj write - share file access denied issue
Using smbj to rite file to shared folder and the below code is giving me access denied issue. But i have mounted the same shared folder under "Network Locations" and i can write file to the ...
0
votes
1
answer
17
views
String to Streaming Output
I´m trying to convert String to StreamingOutput in Java8, but it trims a big part of the last part. The method that has an issue is:
private StreamingOutput stringToStreamingOutput(String str) {
...
0
votes
0
answers
15
views
java.io.EOFException at org.apache.tomcat.util.net.NioEndpoint (tomcat 9 & openjdk 8)
I am upgrading the tomcat and openjdk version for a project. Target: Tomcat 9.0.63 and openjdk-8u322-b06.
However, getting EOFException when using Tomcat 9.0.63 and openjdk-8u322-b06.
I don't know how ...
-1
votes
4
answers
90
views
Why get class cannot be cast to class java.lang.Comparable
I'm iterating all Student data using natural sorting method of java 8 sorted(). While iterating student data, get exception in IDE console class com.java8.Student cannot be cast to class java.lang....
-1
votes
1
answer
60
views
Filter Java 8 list to contain elements based on thresholds defined in other list
I have a sample program below where subject passing marks thresholds are defined in Metadata. The studentMarks list should be filtered in a way so that the resulting list will contain all the subjects ...