Java in Visual Studio Code - java

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?

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.
Installer of Visual Studio Code for Java developers
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.
Java in Visual Studio 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

Could you try F1 -> Java: Clean the Java language server workspace?

Related

Compiling java file in android runtime java

I know this has been asked here and I have tried the suggested solutions but nothing yet to solve. I want to create an java compiler that could run in android in run time using button click but I can't find the right approach to solve the problem.
I've managed to create the lexical,parser and semantic analyzer but I have no Idea how I will convert the string into machine readable language and get the output of the code.
I've tried to download repositories from github but most of it uses Javax.tools api which is not supported in Android Studio.
I still don't understand much about dexing too..
what approach could I use to solve this problem ?

LibGDX development on many platforms

As a student in a software development class I have been assigned to be part of a group project. Naturally our 4 man group decided to make a game. I suggested LibGDX and got a team member to try it, however, when he tried to import the LibGDX project I created in Windows into eclipse on his linux computer it gave him the could not find sdk message. The build was trying to use the SDK path that I had specified in my own windows computer.
Is it possible to have multiple members on different platforms develop with LibGDX. Please let me know if this is not possible, I have already invested multiple days learning how to develop with LibGDX, and hope that there is some way to develop with windows and linux.
Our team work with libgx projects on MAC, Linux and Windows without any problems. Of course you must properly install Android SDK and JDK in every environment, all other dependencies gradle will download for you. I recommend you to use git for effective team work. You can create remote repositories for free on github or bitcucket.
About IDE, I personally prefer to work with Eclipse, but I know lots of people who works with libgdx in IntelliJ. You should just choose what is more comfortable for you.
P.S In order to fix error with SDK your friend got in Linux look at this answer: Importing gradle project, android error
I would actually recommend using a different IDE, I use JGrasp, I recommend that. If it still doesn't work, try to uninstall and reinstall Eclipse, that helps a lot for my friends who use Eclipse, for some reason, Eclipse seems to fix connection issues to dev kits and what not (my friends had the same issue when they were trying to use JSON data). For me, JGrasp handles connection and linking better than Eclipse when it comes to simplicity of it.

OpenFeint with cocos2d-x (iOS and Android)

Apparently OpenFeint supports both iOS and Android. Great.
But how do I integrate it with cocos2d-x Android? The SDK is, apparently a .jar and such. Cocos2d-x uses c++.
I don't get this tutorial: http://blog.molioapp.com/2011/11/openfeint-and-admob-integrated-with.html
I copy & paste the code and immediately I get errors (JavaVM *gJavaVM;? There is no identifier called that way!)
Are there any other steps not mentioned in that tutorial I missed?
Yes. In order to build a C++ library for Android you need to use the NDK. Getting that set up is pretty involved so I am just going to link you to a separate tutorial that has already covered it.
http://developer.android.com/sdk/ndk/index.html#installing
That is the Google documentation on getting up and running. There are other resources for this as well if you have trouble.

Java EE -- Configuration issues for a beginner

all. Relative rookie here who has spent the better part of three days just trying to get started with Java EE, and it's driving me up a wall. I've already read through numerous tutorials and consulted several book, so now I am turning to you.
I am starting from complete scratch, having uninstalled NetBeans and Glassfish and the Java EE SDK. My main issue is quite simply configuration. All the resources I've found typically say in a mere throwaway line: "Once you download the SDK, you must configure your environment for Java EE." But HOW? I need it in plain English. Even the most novice guides leave this basic stuff out. Does this mean editing the JAVA_HOME path or what? How does this configuration relate to the Java SE already on my system? Furthermore, I assume I don't need to also download the JDK with EE since I already have a JDK? (I am a Mac user, if that matters.)
I know I have a long, long way to go, so I appreciate any help I can get as I try to get this ball rolling. Much thanks in advance!
I think if you are using Netbeans then you don't have to worry about these things....
Simply File > New Project > Java Web > Web Application will help you get started with web applications..
Normally you would want to set the Java Home path so when you are compiling and running code your JDK is recognized. Sometimes IDEs come with their own JDK and then it really does not matter. However here is how you would set the path in different OS.
http://java.com/en/download/help/path.xml
For MAC I recommend this tutorial
http://lindaocta.com/?p=38
Make sure your JAVA_HOME is set in environment variables (just downloading SDK is not enough, you need to setup), I don't know how to do it mac, but in windows we setup my right click mycomputer-->Advanced-->Environment variables
Then install Netbeans, this step automatically searches for JAVA_HOME and assumes that SDK for all purposes. Then you are all set of programming.
If you don't mind switching to Eclipse can I recomend this tutorial An Eclipse / GlassFish / Java EE 6 Tutorial ignore the referance to Azzyzt tools and run through the tutorial step by step using GlassFish Tools Bundle for Eclipse.

iphone: integrate java code with xcode project

Please enlighten me on this,
is it possible to execute code written in java or play with classes written in java from xcode project for iphone/ipad.
while googling I got thi
http://hints.macworld.com/article.php?story=20040321163154226 but I guess this solution is not working and is deprecated on mac platforms as well.
Just to highlight I see
Regards
Ankit
No this is not possible, since there is no Java virtual machine available for iOS.

Categories