How to use Robot.mouseMove() fix from openjdk? - java

As per this thread the bug is "resolved" and the fix is available here but I have no idea as to how to use it. I've tried copying over all .java files to my local project but I get errors related to missing Classes. There's also a C++ source file involved which I don't know what to do with.

The Bug is fixed in the OpenJDK itself. So you need to update the OpenJDK on the machine which is running your app and that's it. Be sure to install a version that includes the fix.

Related

Visual Studio Code CTRL+Click with Java stops working after a while

For some reason after having a Java project open for more than 20 minutes, maybe a little more, the CTRL+Click shortcut to inspect classes/methods stops working. When clicking it only appears a loading indicator on the tabs section that keeps going forever without actually loading anything.
Another problem is that when hovering on a method it will stay on "Loading..." forever.
Strangely enough IntelliSense keeps working, so it will still give suggestions while writing.
I am using "Extension Pack for Java" latest version and latest version of VSCode. I am also using JavaSE-11.
Edit: maybe it's worth pointing out that I'm encountering this problem on a Spring Boot project.
Have you installed the extension Lombok Annotations Support for VS Code? It can modify your "java.jdt.ls.vmargs" in the settings.json. Although you have uninstalled it, this configuration will not be removed.
Please check whether you have modified "java.jdt.ls.vmargs" in the settings.json.
If it still does not work please disable all the extensions and only enable the Java-related extensions, and clear the settings.json then to reopen the VSCode.
I had the same problem in the past! So it was because VS Code can't use OpenJDK for its own work. More precisely, it works, but not all plugins work correctly. For VS Code you have to install Oracle JDK particular version and make configured JAVA_HOME environment variable as path to this Oracle JDK. After that you need to restart your VS Code. So, OracleJDK will be used only for VSCode, but if you need, inside your project you can use OpenJDK without any problems.

Running newer code in Java 8 -OR- Updating Java for Eclipse in Mac OS 10.12.6?

I am currently taking a class that requires me to use code created by the professor, but I've run into an issue. Whenever I try to run code that uses the professor's code, i get the following message:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: cs/comsc331/ppm/PPM has been compiled by a more recent version of the Java Runtime (class file version 57.0), this version of the Java Runtime only recognizes class file versions up to 52.0
I know what's causing this, as it tells me - my Java needs to be updated. However, when I go to do so, both Eclipse and the Java Control Panel tell me that I'm all set with the most recent version. I went looking, and on java.com it told me to download Version 8 Update 241, which I did, but nothing changed. When I started looking online for solutions, I came across a post that briefly mentioned that Eclipse would not run with a more recent Java on my system then Java 8.
It seems that I'm at an impasse - I either need a way to update Java without breaking my setup (I tried downloading a more recent version than Java 8 and Eclipse wouldn't start), or I need a way to run newer code on my older system, potentially by recompiling it myself (I tried doing this once and I couldn't figure it out so I could use some advice if this is the best way forward). If I have to recompile the code myself that's okay as there aren't a huge amount of files, but the more efficient the method, the better.
Updating to a newer OS is not an option (if that would even help) because when I've tried to do so in the past, my laptop had to be completely reset (something about it being to hold to handle the new way that files were being done? the explanation I received was unclear).
In the super short term, I've just been straight up copying the code into new files and compiling it on my own, but my professor wants us to work within the existing packages, so that is a bandaid more than anything else. Long term, I need a new laptop that can be fully updated (I got my current one in 2015) but I would assume that there's a more reasonable solution out there.
Thanks!

Files\Java\jjre1.8.0_51\bin\server\jvm.dll file is missing

happens when I try to run Mods on Crazy Craft for Minecraft. Tried their support and no response or solution.
comes up with
Error: missing 'server' JVM at 'C;\Program
Files\Java\jjre1.8.0_51\bin\server\jvm.dll' PLease install or use the
JRE or JDK that contains these missing components.
I've attempted to download several versions of Java and install them but to no success. Anyway can I code it in or download it from another Java?

Error Could Not Find or Load Main Class

Using NetBeans IDE 7.3.1, I modified a desktop application under Windows 7, using JDK 1.7. Performed clean and build, and tested this application under Windows 7, Windows XP, and on a MAC. All test scenarios run under each operating system performed as expected.
This app is ported to outside vendors, and all vendors, except for one, have loaded and executed the app without any issues.
The one vendor encountering problems, and running under Windows XP, returns an error message - "Could Not find or load main class". After doing a little research, this error usually indicates the JDK is different. They downloaded and installed JDK 1.7, but the same error message appears. I had them go to http://javatester.org/othertesters.html, making sure that java was working on the workstation and verifying the java version (1.7). They reinstalled JDK 1.7 and still receive the same error.
I have duplicated the error by removing JDK 1.7, loading JDK 1.6 and running the app. Receive error ("Could Not find main class"). A little different than what they receive, but basically the same problem. Removed JDK 1.6, loaded JDK 1.7 and problem disappears.
I'm at my wits end! I am going to make an appt. to access their workstation. But before I do, I would like to put a plan in place to try different scenarios to fix the problem. I don't know how to proceed, since I've run out of options. I'm hoping for any suggestions.
OK,
Problem solved. Sent application via outlook, modifying executable file from .jar to .txt b4 sending application. I didn't think about looking in compressed LIB directory. Four files were .jar files.
These files were quarantined. Renaming these files to .txt b4 compressing app would have eliminated the problem. Resent the zip, vendor extracted and renamed all .txt files to .jar. All is well.
Appreciate everyone's input.
I believe they still have a JDK 1.6 on their machine and use this, for some reason, to try to execute the application. I've seen this various times at customer workstations.
Very often, people are not aware of what they have installed. Tell them to remove all JDKs and JREs from their workstation, by way of uninstallers and looking into the program folder and deleting stuff manually. Tell them how to do it. Do this with them during a phone call.
Then have them reinstall JDK 1.7. I'm almost sure it will work afterwards.
Alternatively, you can compile the application for older JDKs. You can also do this using JDK 1.7 by setting the target version for the classfiles.
Make sure that their JAVA_HOME path is pointed towards the JDK 1.7 install. I have had similar issues where I had multiple JDKs installed, needed to use the latest, but the computer was pointing to an older version.
To find what version the java_home is type java -version in the cmd.
How to find java_home: How do I find where JDK is installed on my windows machine?

java.lang.NoClassDefFoundError on mac 10.5

My problem started the other day when I tried to run a jar file that was compiled in java 1.6 from a friend. I then got:
java.lang.NoClassDefFoundError
Since I was only using java 1.5 obviously. So I updated using the system update. This did not help and when I ran:
java -version
in the terminal it still said I had java 1.5. I then saw on the internet that there was an "java SE update 4" on apples download page available. I downloaded and installed this file but it still wouldn't work. I gave up and decided to go back to my programming in eclipse. When I tried to compile and run my application in eclipse I now recieved the same error java.lang.NoClassDefFoundError and it wouldnt let me proceed. I tried right clicking the project and viewing the properties but it wouldnt let me, just gave me another error. I figured I might messed something up when I installed the new java version so I tried reinstalling eclipse but it still gave me the same error. I tried creating a new workspace but that wouldnt help either. I then figured I would try to compile throught the terminal using:
javac main.java
java main
But I still get the same error. I went in under systems settings and diabled "java 1.6" and i tried creating new projects with both javaSE-5 and javaSE-6 but it just wont work. My thoughts now is if it has something to do with eclipse not being able to access the bin & src directories in the project directory but that should work if i reinstalled it? I also saw someone mention setting the classpath in os x but I don't know. I would really need some help solving this issue since a lot of my work rely on eclipse working. I would rather not have to reinstall the whole OS just because of this but if I can't get it to work I guess there is no other alternative.
Best Regards
Jonas Kristensson
"Reinstall the whole OS"? Good lord, no.
Your problems have nothing to do with the version of Java. You don't understand how CLASSPATH works.
The class you were trying to run wasn't on the CLASSPATH. If your friend gave you a JAR, you need to add it to your CLASSPATH and use the fully-resolved class name to run it.
A word of advice for your future mental health: When you have problems, don't assume the worst and jump to extreme measures. Try the simple solutions first.
I tried to run a jar file that was compiled in java 1.6 from a friend. ... Since I was only using java 1.5 obviously
Note that if this was really the case you'd get a java.lang.UnsupportedClassVersionError, since Java 5 can't run classes compiled for Java 6 (it might be able to do so, but the class files say "I'm Java 6+" (class version 50) and thus Java 5 would just refuse to run it (max class version in Java 5 would be 49).
Try to compile with
javac -source 1.5 target 1.5 .....

Categories

Resources