VSCode Java Debugger throwing unknown error - java

I had to re-install VSCode on my machine after an issue I was having, and after having done so, I can no longer run my Spring application. There is no error code, thrown, I can't find it in the VSCode logs, and the dialog isn't even copyable.
This is the error dialog displayed:
'void
org.eclipse.jdi.internal.connect.ConnectorImpl$StringArgumentImpl.<init>(org.eclipse.jdi.i...
java.lang.String,java.lang.String, java.lang.String, boolean)'
The launch.json configuration was auto-generated by Spring Initializr, and previously worked. No changes have been made to my JDK or my pom.xml.
I also created a new test app and it had the same problem, so it's not limited to this app or workspace.
Any ideas of what is going on here? (I tried googling the... error... but got not anything helpful)

You need update "Debugger for Java" extension to 0.33.1, which has fixed it.
See https://github.com/microsoft/vscode-java-debug/issues/995
Update: "Debugger for Java" 0.33.1 also requires your VS Code version to be 1.55.0 and above.

Going to go ahead and answer this, as I've fixed it.
I had the latest versions of both VSCode and the Java Debugger extension (I had just re-installed them both).
I wound up re-installing Windows entirely (spring cleaning), and now it's working again.

This error occurs when we don't have the latest version of 'debugger for java' extension. We have to update the version to v0.33.1. In order to update to the latest version of extension you need to have the latest version of VSCode(1.55.0).
You can get the latest version of VSCode from here : https://code.visualstudio.com/
Download the .deb package and then open the file directory in terminal. Use 'dpkg -i filename.deb' command to install the latest version. Restart the VSCode and update the extension.
Note, that after updating VSCode, the extensions might need updating and another restart of VSCode before both VSCode and extensions are running latest versions.

Related

Java Eclipse saying my version of JVM is not suitable

I run the windows 10 64 bit version of Eclipse. The first time I log onto Eclipse it works just fine (though I haven't fun any code yet, so I'm not sure if that works) but upon closing and reopening Eclipse it says, "Version 1.8.0_301 of the JVM is not suitable for this product: version 11 or greater is required." and immediately quits. I have downloaded jdk 16 and installed it. Redownloading Eclipse fixes it until I close it again. How can I fix this? I am a new Java programmer and am not experienced with any of this.
You should have a folder like ths: C:\Program Files\Java. In there, there should be a folder named 1.8.0_301. Delete this folder and reinstall java.
I had the same problem, this solved it for me...
First of all I suggest you check the version of your eclispe IDE. You may have downloaded a version that doesn't supprot your installed jdk.
This link should provide you with the suitable jdk version for every eclipse version.
https://wiki.eclipse.org/Eclipse/Installation.
I hope I helped you a bit.
Cheers!
I had this problem with Java version 1.8.0_351.
In the program management settings of Windows I removed Java 8. After that, my Eclipse installation worked fine.

STS - Gradle - Java Home is different

Today I turn on my laptop and STS shows me this error, and I dont have any idea, Why STS is raising this.
My java home is :
and my gradle project is using java 1.7.
Maybe you can help me to solve this problem.
Thank you.
This can be related to having multiple jdk installs and can be fixed by renaming the other jdk folders, however the true problem here may be caused by a symlink in /jdk1.8.0_71/jre/lib/tools.jar pointing to jdk/1.8.0_71/lib/tools.jar. Remove the symlink and see if Gradle works.

Java OSX Why does the JDK need to be installed for my script to run properly?

I manually created a jar file and it's manifest file through OSX's Terminal. The jar requires the Terminal switch -XstartOnFirstThread in order to run properly on OSX. It worked fine on my mac, but when I tried running it on someone else's mac, the switch wasn't working.
After checking java versions. I noticed that I was running Java version "1.7.0_45" while the computer in question was running only Java version 1.6.......
Downloading and running the latest JRE didn't change this version, but downloading the latest JDK did the trick and now the switch works.
My question is, why would someone need the development kit installed in order to run a jar that I created? That doesn't seem practical. Or am I incorrect in this assumption and installing the JDK included updates that could have been installed without installing the entire JDK?
Sorry if this sounds muddled, I'm just making my way around understanding which kits do what so please be as clear as possible in explaining this. Thanks in advance,

Unable to run Java Applications in Eclipse [duplicate]

I'm trying to get started with Eclipse/Java/Scala on a MacBook. The installed JDK was 1.5. The SDT plugin for Scala requires 1.6 which was included in an OS update, but I also manually installed a package from Apple to update 1.6.
The problem is that I cannot run anything from Eclipse. I always get the following error:
An internal error occurred during: "Launching TestFooBasicTest".
Could not initialize class com.ibm.icu.impl.JavaTimeZone
I also tried to use the old 1.5 version, but to no avail.
What is going wrong here?
I had the same problem trying to run a scala program with Ubuntu 10.4 and stock eclipse (Galileo 3.5.2) and java (java-6-openJdk ) - and the scala pluging downloaded from scala site, of course. I fixed it by manually changing /usr/lib/eclipse/plugins/com.ibm.icu_4.0.1.v20100125.jar as suggested in this thread (btw I discovered that Emacs can change a jar file in place: nice):
http://www.eclipse.org/forums/index.php?t=msg&goto=488654
It's caused by ubuntu openjdk package with broken symbol links for TimeZone configuration. The best solution from forum thread is,
Reinstalling tzdata-java was the fix for me:
sudo apt-get --reinstall install tzdata-java
The problem is:
An internal error occurred during: "Launching TestFooBasicTest". Could not initialize class com.ibm.icu.impl.JavaTimeZone
A quick google search reveals that this class belongs to the IBM Globalization package ICU. http://www-01.ibm.com/software/globalization/icu/index.jsp
A guess would be that this is a package used internally by Scala that you have not installed properly, causing Scala startup to fail.
Make sure that you set java 1.6 in the run configuration (Run/Run configurations).
Did you upgrade to Snow Leopard? Are you using the Eclipse SWT/Carbon or the Eclipse SWT/Cocoa? I was seeing some strangeness with Eclipse after I upgraded to SL. Switching to the Eclipse SWT/Cocoa from Eclipse SWT/Carbon helped. Also restoring my 1.5 VM, which the SL install removes in a sneaky way(by deleting and leaving the symbolic link pointing to 1.6), helped me fix several issues with Java code that had natives(i.e. usb-serial port code).
Check what are the JVMs that Eclipse is aware of and where they are located (Preferences -> Java -> Installed JRE), and also check the run/debug configuration of your programs. By default, Eclipse knows about the JRE that was used to launch itself, and other JREs that you add manually. However, if you upgrade some components and the JREs changed, Eclipse can get "confused" about them.
I had this same issue with Eclipse on Windows. I tried a number of different things including a new hello world program in a new workspace. I finally got this to work by pointing Eclipse to a different JRE to execute with. I know that Apple provides the JRE for Mac, but it does seem like this issue is related to Eclipse having trouble with the JRE used to run Eclipse itself. See here for configuring which VM Eclipse executes with.

Missing libraries with oracle-java7-jdk in eclipse on ubuntu 12.04

I recently installed the ubuntu 12.04 final beta
After installing the oracle jdk from the webupd8 ppa, launching eclipse failed complaining about a missing shared library.
Can't load library: /home/bob/.swt/lib/linux/x86_64/libswt-gtk-3740.so
I searched around, and found this quesion: Eclipse cannot load SWT libraries
As the OP recommended, I tried switching to open-jdk, and that worked wonderfully. The problem, however, is that I am working on a project that doesn't support openjdk.
I tried the second solution as well (the one by scott, which was just creating symbolic links to /usr/lib/jni/... in ~/.swt/lib/linux/x86_64/). Eclipse launches and everything is fine, but it still misses some libraries; this is what I get when i try to run my project:
Caused by: java.lang.UnsatisfiedLinkError: /tmp/libgdx/1352105074/libjogl_awt-linux64.so: libjawt.so: cannot open shared object file: No such file or directory
I know libjawt.so is somewhere on my computer:
$ locate libjawt.so
/usr/lib/jvm/java-6-openjdk-amd64/jre/lib/amd64/libjawt.so
/usr/lib/jvm/java-7-oracle/jre/lib/amd64/libjawt.so
But eclipse or java seems to think that libraries should be placed in ~/.swt/lib/linux/x86_64, isn't that weird?
Eclipse when launched defaults to its own internal JRE, as I understand. I recommend the following:
Modify your CLASSPATH variable to include the path to the desired libraries;
Set your JAVA_HOME to match the actual JAVA_HOME;
Setup Eclipse to launch from the desired JVM by customizing the eclipse.ini using this information: http://wiki.eclipse.org/FAQ_How_do_I_run_Eclipse%3F#eclipse.ini
Also, can you specify the -classpath option when Eclipse is launched?
Try downloading the latest version of Eclipse and running it. For some reason it works fine. I just ditched my older version of Eclipse. I hope this works for others!
Please note that there are two Java runtimes in play here. The one used to run Eclipse itself, and the one you want to run your code. They do not have to be the same!
I would suggest
Run Eclipse with a JDK that works
Download Oracle JDK manually and unzip it to a folder in your home directory
Tell Eclipse about this additional runtime (http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-add_new_jre.htm)
Configure your project to use that JVM instead. (http://help.eclipse.org/mars/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-assign_default_jre.htm)
Now your own code is compiled against, and runs with Oracle Java.

Categories