I am attempting to set up JAVA in Visual Studio Code and I can not get it working. I am getting an error that states "Linkage Error occurred while loading main class Hello". I have researched numerous sites and have not found any solutions that I understand. For example, I have seen several sites that state you must "enable-preview" on some setting but there are no directions on how to actually do that. I have installed the jdk-11.0.4 jdk version. I have never programmed in java so I do not know what is required. I reviewed several you tube videos and of course their installation went off without any problems! Is there anyone here that can help?
-
Problem is: without a real minimal reproducible example we have no idea what exactly you did, and therefore where your problem(s) originate from. I suggest: start with a good book or tutorial and the most basic hello world example. Don't use any sophisticated editor to compile / run your code. Instead, learn how to do that manually on the command line. And then, when you understand these basics, then move on and go with such tools.GhostCat– GhostCat2019-09-27 02:38:57 +00:00Commented Sep 27, 2019 at 2:38
-
While I appreciate the response I am somewhat confused as to what to do next. I am not sure there are any books on how to install JAVA in Visual Studio Code. From my research this seems to be a common error that individuals like myself are receiving when attempting to use JAVA in Visual Studio Code. As I stated I found several references to this error but not any clear directions on how to solve it. I am hoping that someone from this community can assist.Dave Hock– Dave Hock2019-09-27 02:47:16 +00:00Commented Sep 27, 2019 at 2:47
-
Just an FYI, Java is not an abbreviation for anything. It's just a word. No need to capitalize it all.AHungerArtist– AHungerArtist2019-10-14 07:49:03 +00:00Commented Oct 14, 2019 at 7:49
2 Answers
As per their documentation link, there are two ways to setup and run java with VS code
They have created a special Installer of Visual Studio Code for Java developers. The package can be used as a clean install or an update for an existing development environment to add Java or Visual Studio Code.
Alternatively, you can also add Java language support to VS Code by installing the popular Java extensions by yourself.
Please see link below to setup and let me know if you face any issue in setting up and run java with VS Code.
There might be two reason to not identifying Java
- Might be java is not installed correctly
- Or there are multiple version installed so might be conflict