VSCode for Java on FreeBSD - java

After installing the Java Extension Pack, Spring Boot Extension Pack, and Lombok, I created a basic Spring Boot project just to test out VSCode (I followed the Spring Boot initializer which works surprisingly well).
I attempted to run the application (barebones / skeleton project) and when clicking on the "Play" button and selecting "Run Java", the Run dialog hangs indefinitely.
I can run the project from the command line, using maven to compile it followed by java -jar; however, I want to be able to do everything in VSCode including running and debugging.
I clicked on "check details", but there isn't any information for me to go by and make an educated guess as to what is going on.
EDIT:
Just to be clear, I am running VSCode on FreeBSD (which is not Linux).

you can have a look on this extension whitch look like Boot Dashboard in Eclipse and it enable you to manage your application and have a control above it andu can run multiple projects using it in this Link.
Note: i think it need java 11 to work

Here is a description of how to use springboot. You can refer to it to see if there is a problem with any operation.
https://code.visualstudio.com/docs/java/java-spring-boot

Related

Run intellij plugin from cli in Windows 10

I'm developing a plugin that analyzes source code in a project. Now I need to run it on a great number of projects, so I decided to automate the process. Looking for a way to achieve this I found that I need to implement ApplicationStarter interface and declaring it as extension point in appStart category, as described here:
Intellij - how to make a plugin that can perform IDE actions via a CLI or web service?
Although, I was not able to execute my custom command. When I run
idea64 mycommand
a loading screen of intellij starts and then nothinng happens. I have to kill the process via task manager. My version Is 2020 on Windows 10.
I'm writing here too as on jetbrains I've received no answers yet.
Is there something i'm missing? Thank you in advance.

Problem with creating a Spring Boot Application

i am still a beginner with spring boot, and i have a bunch of questions.
First of all, do i have to download maven in my pc and add it to my pc path envirement to make spring boot work correctly ?
Secondly, Spring boot wasn't able to work, was doing a hello world app and there were lot of errors on the console one of them is "SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".. why that ? i looked for the error and followed some mvn command line steps "mvn dependency:purge-local-repository", and my app finally worked.. but do i have to run this command everytime i create a spring boot app ? isn't everything supposed to be alright since it's only a hello world app ? ..
Thank you
Yes, you need to have installed maven or gradle in order to run your application. And it needs to be reachable, so you have to configure your system variables accordingly.
You can find more details here.
As per the maven error, maven keeps all the artifacts you need to run your application in a shared folder with all versions, sometimes maven could have corrupted files or a mismatch in version so you need to purge the repository and download artifacts again.
You can find a more detailed answer here.
Even when you are coding a simple application, spring-boot bring up a lot of code for supporting operations you may require, such code is self configured and hidden.

Scriptable Eclipse run/debug configuration [duplicate]

I'm finding it difficult to phrase this question well, as there are quite a few generic terms (run, configuration, launch, etc.). Here goes:
You can save run configurations in a .launch file. (in the Run Configuration Dialog, under the Common tab, Save as a shared file.
We check these in to SVN. The developers can pass them around, and it helps getting new devs running a working application quicker.
I'd like to check these out as part of our build and use them to programatically run the application, the tests, etc, without spinning up the whole IDE.
What would be the best way to run a .launch file outside of the UI?
Edit: I am trying to unify the tests run on the build server and the IDE. I do not
particularly want to give up integrated debugging, which would be the case with an ant script to run the tests .
This is probably more a problem for integration testing with multiple bundles, or unit testing a whole bundle, where you'd like to mock up extensions.
there is an eclipse plugin built over JUnit, called TPTP. It provides an automation client which can be used to launch the test from eclipse with no gui. maybe it helps
Ant4Eclipse may provide a good starting point on how to do this.
Unfortunately, this is limited to Java Applications and JUnit configurations; I am more interested in PDE applications and Plugin JUnit tests.
I have recently had alot of success building an Eclipse RCP app inside a Hudson CI server using Eclipse Buckminster. It took a bit of doing, but once I setup both features, made my RCP product be based on features, and added the Buckminster query files and the like, it worked. There is a Hudson/Jenkins Buckminster plugin that allowed me to have hudson build the application.
After saving the launch configurations for each test fragment, I created hudson commands to invoke them (yes one line per test fragment unfortunately), but after that I got the automated CI build that I wanted.
You could also use the shell command Eclipse uses. To get it:
Run your program in Eclipse
Go to the "Debug" view
Right-click on the process (probably the second item in the tree) and select "Properties"
Copy shell command and delete the agentlib flag to run in bash
I think you don't need to use the .launch configurations to run the tests. If you build an application using the Eclipse Build System, then you can use the AntRunner application from Eclipse to run your units tests. This doesn't start the whole IDE.
This article describes how to run the tests during your build process. With this process, you use a special "Test" Eclipse and load the plugins you want to test.
Perhaps running the configurations the way you would run your own custom run configurations would help here. It is described in this article.

See Ant script generated by Netbeans

Please see the following webpage: https://netbeans.org/features/ide//build-tools.html. It says: "You can therefore build and run your project outside the IDE exactly as it is built and run inside the IDE.".
I have spent hours trying to figure out how to see this Ant Script. I have found suggestions such as setting: Toola\Options\Ant\Verbosity Level to Debug etc, but I see nothing. How do I see the Ant script generated by Netbeans?
I am trying to see what Netbeans generates when I run the app, so that I can try to run the app externally to Netbeans. It is a J2EE app.
Look for build.xml
But J2EE apps must be run inside a webserver such as Tomcat.
You can't run them from the command prompt.
You can follow the Java EE tutorial regarding that topic: http://docs.oracle.com/javaee/6/tutorial/doc/gkhpu.html#gkhol
In case you would decide to use Maven, then the newer version can be more applicable: https://docs.oracle.com/javaee/7/tutorial/usingexamples.htm#GFIUD

Spring MyBatis w/o Maven

So I integrated MyBatis with Spring successfully(?) I think, because all my jUnit Test Methods are working correctly. I only received this error when Im trying to launch the web app locally on my tomcat server here is the stack trace:
Here's my web.xml
I can provide you with more of my codes if you want to. And yes I didn't use maven here.
UPDATE: Added a screenshot of my packaging.
UPDATE: Added library screenshot. Prolly thinking because of the version of spring?:
I think, after your descriptions the problem is, that Eclipse is not recognizing your libraries automatically (otherwise, they would have a small added icon on its main icon, which would look like the Libraries icon). The reason for this could be, that you have configured WEB-INF as source folder, which it shouldn't be (since you don't have any Java sources in it). So first i suggest to remove that configuration. Then Eclipse should pick your libraries automatically, when you deploy the application.

Categories