My plugin doesn't show up in Eclipse "Show view" - eclipse-plugin

I created my first Eclipse plugin.
Plugin has one view.
When I ran my plugin project(Overview>Testing section>Launch an Eclipse application), it shows in Eclipse workbench and "Show view" menu.
Then I copy & paste exported plugin jar file to Eclipse's plugins folder.
Unfortunately I can't found my plugin view in Show view menu.
I also paste dropins and dropins/plugins folder.
But it doesn't works.
OS : Windows 7
Eclipse : Eclipse Java EE IDE for Web Developers [Kepler Service Release 2]
plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.views">
<category
name="String Table"
id="com.andcontinue.stringtable">
</category>
<view
name="String Table"
icon="icons/sample.gif"
category="com.andcontinue.stringtable"
class="com.andcontinue.stringtable.views.StringTable"
id="com.andcontinue.stringtable.views.StringTable">
</view>
</extension>
<extension
point="org.eclipse.help.contexts">
<contexts
file="contexts.xml">
</contexts>
</extension>
</plugin>
I don't know why plugin be not displayed in Show view.
Other references
build.properties
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
.,\
contexts.xml,\
icons/,\
META-INF/,\
.classpath,\
src/,\
MANIFEST.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: String Table
Bundle-SymbolicName: (MyPackage);singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: (MyPackage).Activator
Bundle-Vendor: Vendor
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.8.101",
org.eclipse.jdt.core;bundle-version="3.9.2"
Bundle-ActivationPolicy: lazy
Export-Package: (MyPackage),
(MyPackage).views
Import-Package: org.eclipse.jface.text
Bundle-ClassPath: .
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Please help me.
Thank you.

Some Clues:
Check after installation of plugin whether is it appearing in Running Platform. Go to Window > Preferences> Plugin Development > Target Platform select Running Platform click on Edit and check your plugin. The presence shows that Platform detected your plugin but there may be some issues in your code.
Note: I am assuming you used the Running platform as your target.
Instead of directly copying the jar into folder. Install this plugin via GUI.
Export your plugin to an external folder or to an archive file. Go to Help > Install New Software... Click on Add button then select a local folder or archive file. If there were some problems exists while exporting then this installer displays this.

This may also happen if the plugin you are using expects latest version of some library or compiler in your system. In my case, I was trying to install SonarLint plugin and although installation was successful, I could not see it in View because it only supported Java11 or above. You can check out further details of it in my answer here

Related

What is required to run a hello world in kotlin with IntellJ

I have a Mac (Catalina OS) with Java 15 and IntelliJ 2020.2 (community edition) installed. The kotlin plugin is also installed. When I create a new Kotlin Project, add a main function, then there is way to run it, there is no 'Start' Button next to the main function. The problem is obviously that it doesn't find the runtime. The iml file looks as follows
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="KotlinJavaRuntime" level="project" />
</component>
</module>
When I click on 'add framework support', I can add a new KotlinJavaRuntime which then just appends an <orderEntry> to the iml file with the name KotlinJavaRuntime (2).
I don't want to use maven or gradle here. I know that gradle can resolve the dependencies for me. I just want a plain vanilla Kotlin hello world project. The documentation has a 'Getting Started with IntelliJ IDEA' section which just mentions the Kotlin plugin for IntelliJ. There seems to be no requirement to have gradle or maven installed, the plugin should do it.
I know that you can use brew install kotlin to install the SDK manually, but then the documentation is wrong and the plugin alone cannot run Kotlin with a prior manual installation of the SDK or the usage of maven/gradle.
I think I know what happened in this case.
The Kotlin Code was loaded as an 'IntelliJ' Module inside a Java project that was using maven. In IntelliJ there's a hidden folder .idea/libraries/ which was missing the description of the Kotlin Runtime (this makes sense, since the dependencies were managed via maven). I have restarted and created a new project from scratch. This time you'll see the file .idea/libraries/KotlinJavaRuntime.xml, which is exactly what is referenced from the iml file. The .idea folder is very magic. For me the confusion is that modules in IntelliJ are not really isolated from the project, they share - like in this case - the .idea folder.
I hope this helps also other users.
If you created the kotlin-file yourself, you have to tell IntelliJ that it should run this file.
Normally shows a run icon next to your main method.
run button/icon
Option 2: Right Click on the file containing the main method and see if there is a run this file option.
Option 3: add run config manually
Click add config which should be on the left of the run button (don't mind that it is disabled)
Click + and choose Kotlin.
Set main class to MainKt which is the default for kotlin

Auto deploy on save Netbeans entreprise project using maven

I have a NetBeans mavenized project Contaning:
web project (war)
ejb project (jar)
parent project
maven project
After every change I must clean an build the maven project and Run the Parent project
How canI configure my projects to auto deploy on save ?
the configuration file(nb-configuration.xml) is as follows :
<?xml version="1.0" encoding="UTF-8"?>
<project-shared-configuration>
<!--
This file contains additional configuration written by modules in the NetBeans IDE.
The configuration is intended to be shared among all the users of project and
therefore it is assumed to be part of version control checkout.
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
-->
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
<!--
Properties that influence various parts of the IDE, especially code formatting and the like.
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
That way multiple projects can share the same settings (useful for formatting rules for example).
Any value defined here will override the pom.xml file value but is only applicable to the current project.
-->
<netbeans.compile.on.save>all</netbeans.compile.on.save>
</properties>
</project-shared-configuration>
right click on your project then select 'properties'. Now, click on 'run' option here select deploy on save. Hope it helps.
Sometimes, restarting NetBeans and server helps to solve autosave problem. It's truly strange, but in my case it helped.

How to assign sources to Ivy library in IntelliJ IDEA?

I created a Webapp with an Ant/Ivy build using Spring framework and imported the project into IntelliJ IDEA. Using the IvyIDEA plugin the dependencies are resolved and a library with the jars is created automatically by the plugin.
How can I assign the sources (they are downloaded and stored in the ivy cache) to the Idea library so I can just click on a class of a dependency to browse the source?
To see ivy's cache libs I did these steps:
1) Add library folder (Choose Java from + menu):
2) "cache" item will be added to libraries. Choose all modules of your project that should now see "cache" library (you could also add inside 'dependency' tab on each module)
3) now you should tell intellij to check recursively inside cache folder. To do this you must edit a file as follows:
File is located in your project folder under .idea/libraries/cache.xml
<component name="libraryTable">
<library name="cache">
<CLASSES>
<root url="file://$USER_HOME$/.ivy2/cache" />
</CLASSES>
<JAVADOC />
<SOURCES />
<jarDirectory url="file://$USER_HOME$/.ivy2/cache" recursive="true" />
</library>
</component>
recursive property must be set to 'true'
It has to be explicitly enumerated in ivy.xml (at least in my Idea 11.1.5), i.e. sources are not shown for packages resolved as dependency of packages stated in ivy.xml. After introducing it is necessary to refresh modules (Tools->IvyIdea->resolve for ...).
See also:
https://code.google.com/p/ivyidea/issues/detail?id=92

IntelliJ: how to make non java files copied to the bin directory as well?

My module contains some non java files along the java source files. When the module is built, the java files are copied to the bin folder (and included in the jar artifact), but the non java files are left out.
I need them to be copied as well (this is what Eclipse does). Note, that they do appear in the project tree view on the left, I did not exclude them in any way.
How can I make them get into the bin folder (jar artifact)?
Thanks.
Settings (Preferences on Mac) | Compiler | Resource Patterns.
This question duplicates/relates to:
copy jbehave stories into target directory using IntelliJ Idea
IntelliJ, Akka and Configuration files
IntelliJ IDEA 11.1.2 does not copy SQL files to the out folder
Add a properties file to IntelliJ's classpath
import images into an intelliJ Java project
Intellij - how do I add a text file to the resources
Null Pointer Exception for read properties file in Idea
IntelliJ Idea - resource SQL files not being copied to target
Scala getClass.getResource() returning null
On IDEA 14.1.4, the xml file in src/main/java/my/package folder is not copied. My compiler settings are !?*.java;!?*.form;!?*.class;!?*.groovy;!?*.scala;!?*.flex;!?*.kt;!?*.clj;!?*.aj.
I changed the gradle file by adding:
test {
resources {
srcDir 'src/main/java'
include '**/*.xml'
}
}
It starts working. I am not sure if I have missed anything, but I could not find that part reflected on project settings.
If you are working with Maven, the following code should have the same effect:
<build>
<testResources>
<testResource>
<filtering>false</filtering>
<directory>src/test/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</testResource>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
</build>
I posted it here as an answer, because it may help someone who has the same issue and the above answers may not work.
Uncheck use external build in project compiler setting.
Using CrazyCoder's info about version 12 (which I'm not using), I added the following as my resource pattern which worked well:
*.*;!*.form;!*.java;!*.class;!*.groovy;!*.as;!*.flex;!*.kt

How do I install JQuery into my web app using Maven?

I am looking at using Maven 3 for some web development. I know how to use maven to resolve java based jar files. How do I use maven to resolve JavaScript dependencies for example I want to have maven automatically put jquery in my webapp/js folder?
Is it possible to do transative JavaScript dependencies with Maven 3?
You could create your own "war" that has jquery in it on the path you specified.
Afterwards add that war to your real web application. Maven should merge it. I think it was called somehting like "processing overlay".
I'm using the same for some GWT application where the javascript is generated by a maven plugin and it works well.
Perhaps WebJars can help you:
WebJars are client-side web libraries (e.g. jQuery & Bootstrap) packaged into JAR (Java Archive) files.
Explicitly and easily manage the client-side dependencies in JVM-based web applications
Use JVM-based build tools (e.g. Maven, Gradle, & SBT) to download your client-side dependencies
Know which client-side dependencies you are using
Transitive dependencies magically appear
Caveat: WebJars does not put the jquery files in the webapp/js folder. Please read documentation to see how it is used with some popular frameworks.
Try adding this to your pom.xml file. It worked for me :
<dependency>
<groupId>com.efsavage.jquery</groupId>
<artifactId>jquery-maven</artifactId>
<version>1.7.2</version>
</dependency>
This library gives you a way to drop jQuery into your project as a Maven dependency, which means you don't have to include these third party files in your own source control.
Source : here
May be you should use one of CDN to include external javascript libs to your webapps?
E.g. for jQuery you can simple include it from any of URLs from http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery
Also libs from CDN will reduce your server bandwidth usage.
You can create a new zip artifact in your repo with your version of jquery inside.
Then use the maven war plugin to deploy it to your war.
Take a close look at <targetPath> and <includes> to be sure to deploy what you need where you need it :)
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.3</version>
<configuration>
<overlays>
<overlay>
<groupId>yourgroupid</groupId>
<artifactId>yourJqueryArtifactId</artifactId>
<type>zip</type>
<targetPath/>
<includes>
<include>js/jquery.js</include>
</includes>
</overlay>
</overlays>
</configuration>
</plugin>
the previous config supposes that you have a directory called 'js' in your zip with jquery.js inside. It will be unzipped in your war at js/jquery.js
More info here