I have developed an RCP plug-in (not standalone), and a Java Project with library code that the plug-in needs to call.
I have configured the Java Project in the same workspace. The plug-in has a project dependency on the Java Project.
The code compiles (the plug-in does some stuff with the Java Project / library code).
When I run the plug-in, I get a ClassNotFoundException:
java.lang.ClassNotFoundException: com.mycode.ArgSet
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)
Anyone know how to configure the plug-in properly?
Convert your library project to a plug-in project (right-click -> Configure -> Convert to Plug-in Project) and add it to the dependencies of your plug-in project (manifest editor, Dependencies tab).
You can also generate a JAR of your libray Project and add this jar to your plugin-project. That's the way we do it (but thats not that automatically, you have to export manualy every time you change the library-project.
The other bad with this jar-export is: when using another libraries (i.E. AXIS2 for Webservice,...) this Libraries must have also been added to the plugin project.
Related
I am using Visual Studio Code with Red Hat Java Plug-in and Debugger for Java plugin. I got a problem that:
1) If I work with a single module Maven project, everything is ok.
2) But if I open a multi-module Maven project, the debugger cannot start because of "java.lang.ClassNotFoundException: org.springframework.boot.web.servlet.support.SpringBootServletInitializer"
3) The project can be built with Maven, and running the Jar is all right
I guess the problem is because of the classpath settings, however to my understanding, the .classpath file should be derived from the POM file, which should be correct, otherwise Maven would have not been able to build the project.
I did not manually modify the launch.json, and the plug-ins generated the settings for me.
I'm developing an java application. I'm using eclipse Luna and Gradle as my build-system. I can define dependencies in my build script and they get downloaded on a build. That's no problem... But how can I tell eclipse, that it should automatically download and add the dependency to my build path?
I wan't to use auto completion and so on, without manually downloading an jar and copy it to the project.
Is it possible?
Regards
Marc
You need the Eclipse Gradle tooling, which adds lots of Gradle-related functionality. Most importantly, it manages your Eclipse project build path to match the build.gradle dependencies.
I've a library on which my plugin depends. its been added in the lib directory under the plugin project and added to bin.dir to be shipped with the plugin.
Is there a way to remove it not to be shipped with the plugin and force eclipse to search for it during installation ?
First create a plug-in for your library through the Plug-in from Existing JAR Archives wizard.
Add the new plug-in as a dependency to your plug-in.
During provisioning operations your plug-in won't be installed without it's dependency.
Trying to install your plug-in to an Eclipse installation that does not already contain the library plug-in will fail with an error.
However, this is not usual in the Eclipse world.
Ideally, you should ship both plug-ins as part of a feature.
A Feature is used to package a group of plug-ins together into a
single installable and updatable unit.
My web project includes Groovy class files.
How should I compile it for my project using Eclipse?
Rest of my team is using IntelliIDEA to use it but I want to set it up in Eclipse.
To start with I have installed a Groovy Plug-In for my Eclipse and installed Groovy on my Windows.
You should be able to right click on the project -> Configure -> Convert to Groovy project.
If your project is a maven project, then you should also install m2eclipse as well as the optional m2eclipse configurator for groovy-eclipse. This will automatically configure your project for Eclipse and groovy.
Hope this links helps you. It has step by step on how to import your existing Groovy Project into eclipse so you can work on it.
http://docs.codehaus.org/display/GROOVY/Create+Your+First+Groovy+Project
If the project is created using grails create project, I believe all of the .project and .setting files are there for eclipse.
If you have the groovy eclipse plugin installed you should be able to mix your groovy classes into the same packages as your java code. Are you using maven or ant to build your actual war file? If not you will have to make sure that you compile the groovy classes along with the java code. while in eclipse you will be fine. Both ant and maven have facilities for compiling the groovy and java code together for your actual war that you deploy.
How to create new Eclipse RCP project using Maven (preferably m2eclipse)?
I read that there's plug-in for Maven that have idea about Eclipse.
(Maven Eclipse Plugin) And then it looks like I need to find some Maven Archetype to create Eclipse RCP project, but I could not. At this point I am in doubt if I go right way.
I just want to use maven dependencies resolution and other features in my RCP application development.
P.S. I found that it is possible to "Enable Dependency Management" via m2eclipse.
The other option is to make 2 project: maven project and Eclipse RCP project that will reference the first on classpath. What is the smart way?
P.P.S There's also option to use Eclipse dependency resolution mentioned here
Convert your library project to a
plug-in project (right-click ->
Configure -> Convert to Plug-in
Project) and add it to the
dependencies of your plug-in project
(manifest editor, Dependencies tab).
Maybe Tycho (http://tycho.sonatype.org/) will help you. Currently, it seems to be a little bit alpha, but after releasing Maven 3.0, Jason van Zyl promised to spend more time on Tycho (http://www.sonatype.com/people/2010/10/maven-3-0-has-landed/).
Pending all the maven3 magic highlighted in Steve's answer, you do have this Maven RCP build recipe, based on the pde-maven-plugin (as presented in the Eclipse Plugin Development Environment support page)