Intellij custom plugin not working it says manifest missing or unable to recognize main class - intellij-plugin

I have created jar file for Intellij custom plugin and while trying to check it by running it like
java -jar it says no main manifest attribute, or some time says not able to recognize main class.
Looking for solution to create intellij custom plugin jar

Because this is not how you should create and build plugin.
Please follow the Creating Your First Plugin guide in the official IntelliJ Platform SDK DevGuide for more details.

Related

Can't load the main class/runnable jar JavafX 8 project [duplicate]

i created a Javafx project using JDK 8 and when i tried to export it to a runnable .jar file, i got surprised that it doesn't run using CMD, and gives the following error :
"Javafx compenents are missing"
while it works perfectly during the compiling time(using the IDE) when i accessed the .jar files, i found it has just .class files (that i made), and the needed library files that haven't been exported (i made sure to select the "extract need library files extract required libraries into generated jar" option in Eclipse), is there a reason behind of this? and a way to solve it? thanks in advance
Ps: i tried this using Eclipse and Intellij IDE
I just wanna mention once again that I'm using JDK 8 where it has JavaFX library inside of it.
Did you try this?
There are detailed instructions on how to configure your IDE to run JavaFX with newer OpenJDKs (which do not come with JFX components in it).
It also explains how to create a new JavaFX Maven project from archetype, with all the necessary plugins to easily build your application while including the minimal Java components for it (using jlink).
This will ensure that anybody using your application will have those components.

How to put Maven Tycho Dependency in my Eclipse Plug-in?

I've created a new project using tycho 0.26.0, it runs with Eclipse 4 Neon.2, so all modules are building successfully using maven, now I am trying to add a new dependency in my project, I have created a jar and I want to use it in my project, but I don't understand so good how is it working.
I add I am using a target definition, so I have to add my configuration to this file, this will be used by my modules.
I don't know if I got your question right.
I assume you want to build an Eclipse RCP application with tycho and use an JAR file from one of your plug-ins.
The simplest solution is then to create a new plug-in project from this jar by using the Plug-in from existing JAR Archives-Wizard.
If you have done this, you can add a dependency from this new plug-in to your existing plug-ins. Don't forget to export all packages of the library, by opening Manifest.mf and adding all packages in the Runtime tab.
To get this running with maven you have also to add a pom.xml file to the new Plug-in. This link help me a lot with maven tycho (http://codeandme.blogspot.de/p/tycho-articles.html).
Btw. if you don't need this library as plain JAR, you can also create directly a Plug-in project instead of first creating a JAR and then creating a Plug-in project.

Can't produce an executable jar from Spring Boot, Gradle, and IntelliJ-Idea

I have created a Spring Boot Microservice using IntelliJ-Idea and Gradle as the build engine. I have made no changes to the initial Spring Boot configuration. I also have made no modifications to the build.gradle file provided. I built the application using starter.spring.io through IntelliJ-Idea and have the following dependencies:
compile('org.springframework.boot:spring-boot-starter-data-jpa')
compile('org.springframework.boot:spring-boot-devtools')
compile('org.springframework.boot:spring-boot-starter-web')
runtime('org.postgresql:postgresql')
testCompile('org.springframework.boot:spring-boot-starter-test')
The application currently contains 12 classes and 2 interfaces and is a Web Service provider. It runs fine on my system but when I build with Gradle, the Manifest.MF contains no Main-Class entry.
I created a very simple Hello World app and tried several combinations of IDE’s and build tools(Gradle and Maven)
and got the following results:
 
 
Interestingly, I was able to produce executable jars in Eclipse which has a separate Runnable JAR Export process.
I'm fairly new to IntelliJ and Gradle. Has anyone see this behavior before? Any ideas what I might be doing wrong in IntelliJ? I have my Hello World project zipped up if anyone needs it.
I took the advise of M. Denium and I did the Gradle build from the Command Line. The jars created were formatted correctly to be executable. Everything worked like a charm. In fact the Main-Class is a Spring Boot class called org.springframework.boot.loader.JarLauncher and the main class for my app was in a property called Start-Class. The IDE totally misses this.
Looks like you will need to include spring boot plugin for gradle - org.springframework.boot:spring-boot-gradle-plugin
More details in the gradle section of the getting started guide

Why IntelliJ does not show errors in java code?

How to configure intelliJ to disply errors in java code like eclipse?
see the screenshot
It does show the errors you expect, if you don't have the JUnit jar files in the classpath.
I created the exact same file as you showed in my IntelliJ and it really shows the errors:
What you might have done is that you have probably accidentally added the jar to the classpath.
Check the External Libraries as you can see in the picture. If there is no JUnit there, then it really is missing.
Now I can easily add the JUnit jar from IntelliJ and you'll notice the difference in the External Libraries:
Here it has been added under External Libraries and the error goes away.
You almost certainly already included the junit library into your IntelliJ project configuration.
This is easy to do, since IntelliJ has a quick action (alt-enter) to Add junit to classpath.
Look in Settings -> Libraries / Global Libraries and you will see it there. :)
Or you can look directly in Settings on the relevant Module -> Dependencies
Either that, or the project you are working in is configured already (perhaps via maven?) to have a junit dependency.

Eclipse plugin view does not show up after install

I created a sample plugin which includes a simple view in eclipse and ran the plugin from inside the workbench, my plugin is installed and I get my view showing up in Window/Show View/Other... . I packaged the plugin as a jar file and installed it under the plugins directory of eclipse and restarted my eclipse workbench. I am not able to find my plugin view. I dont know whats is wrong
I am using eclipse RCP SR2 (3.6) for developing plugins and my packaged jar file includes the code, META-INF/MANIFEST.MF and plugin.xml files.
I created the plugin from the book 'Eclipse Plug-ins, 3rd Edition'. I followed the steps outright and am not able to set up the plugin as a jar file.
I got it to work somehow? The plug-in project was created using Execution Environment JavaSE-1.6. 'It was given in the book I referred'. Now the manifest editor had the entry 'Bundle-RequiredExecutionEnvironment: JavaSE-1.6'. Now I ran the application with-in eclipse, it was working. But when I bundled the plugin as jar and copied the plug-in jar under plugins folder and restarted eclipse the plugin was not working, I dont know why, I thought my eclipse is not running under JRE1.6, but I checked my Windows->Preferences->Java->Installed JREs-> I have only jdk1.6.0_27 checked (So I assume that the eclipse is running under JavaSE1.6). This is bit confusing for me! I removed the Execution Environment entry in the Manifest editor Overview tab. Now there is no 'Bundle-RequiredExecutionEnvironment' entry in my Manifest, I created the bundle jar again and installed in eclipse plugins folder and restarted eclipse using -clean option. It started working in my eclipse. I got it to work somehow but with no understanding! I am still looking for answers from some one who can help me figure out what went wrong?
Open an OSGI console and type 'ss'. It should list all of the plugins. Can you see it? What is the state of it.
You can use Preferences/plug-in development/target platform edit running 'running platform' content tab to list and check/uncheck plugins. I hope it helps.
You could try copying your jar file to the eclipse/dropins folder.