I’m having a problem with BufferedImage in runtime. I’m loading an .png, but the BufferedImage is null. I don’t get an IOException, but an NullPointerException. And the biggest problem to me, is that when I run this same code in netbeans he works fine… My code is The ApplicationPropert…
Tag: runtime
Command is Not Interpreting in Java [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 2 years ago. Improve this question I hav…
Adding module export to mvn test execution runtime
Getting this error during tests: I’ve tried creating jvm.config at the root, next to pom.xml as such That doesn’t change anything. So i try to configure maven compiler plugin as such: for the record i even tried it so: Nothing. Then i tried surefire plugin like so : Two days working on this and fa…
Mac OS Catalina “to open eclipse you need to install the legacy java se 6 runtime”
PROBLEM : Although I successfully installed Java JDK Kit and Eclipse on my MacOS Catalina 10.15, I cannot launch Eclipse. I get this error message: “To open eclipse you need to install the legacy java se 6 runtime” BACKGROUND : I am starting to learn java programming. I wanted to install java and …
Speed of custom Java classes vs. Maps
Which is faster: a Set whose elements are each an instance of CustomObject as defined below: a Set whose elements are each an instance of Map<String, String> where each Map is of the format {“A” : Avalue, “B” : Bvalue, “C” : Cvalue}? or any other data structure that y…
Executing Java code inside a Java program
I would like to create an application which for example measures the execution time of a certain block of code. In this case it should have a structure like this: I’m curious about the method designated by the arrow, I need some sort of a placeholder. How should be this method implemented? Is it even po…
Java Process cannot get the InputStream through Runtime.getRunTime().exec()
The Code has issues with getting the InputStream from the Process, because if I run the Shell script from my Terminal it runs completely fine, but if I Run the Script like this,the str is always null, I am using this code to get the output of the Shell Script directly into Java instead writing the Script Outp…
Java Error opening registry key
I get this error when I try to do anything with Java in command prompt: I did screw around with deleting Java directories and registry a few days ago. I restarted computer and java was still working fine, then i restarted it again today and now I get this error. I have tried uninstalling and reinstalling but …
How to check existence of a program in the path
I’m writing a program in scala which call: I want to check if “svn” is available from the commandline (ie. it is reachable in the PATH). How can I do this ? PS: My program is designed to be run on windows Answer Here’s a Java 8 solution: Replace anyMatch(…) with filter(…).f…
During execution, how can a java program tell how much memory it is using?
During execution, how can a java program tell how much memory it is using? I don’t care how efficient it is! Answer VonC’s answer is an interactive solution – if you want to know programatically, you can use Runtime.totalMemory() to find out the total amount used by the JVM, and Runtime.free…