How to export Eclipse 3.5 servers to Eclipse 3.6 - java

At work we're planning to upgrade from Eclipse 3.5 Galileo to 3.6 Helios and I'm creating a little migration guide for everyone to use together with all needed configuration files to be imported.
The idea is to do clean install of the new Eclipse version and just use the current workspace and external plugins directory (a per this and that)
So far it all seems to work fine, I have succesfully exported/imported the libraries, run/debug configurations but I don't seem able to export the various Tomcat and JBoss server configurations i.e. runtime and server definitions. I can only re-create them manually...
Is there a way to export these from the Eclipse GUI or perhaps some metadata or config file somewhere that I can hack?
Thank you and adios,

Give the special plugin e4preferences a go.
It is the only way I know to obtain a fine-grained preferences export.
The only other way is to export everything, and to grep the lines of interest in order to copy those lines in a new preference file, and import that new file.

Related

Auto-install Eclipse Lombok plugin - Java

We just started using Lombok plugin for Java.
Developers in our company use Eclipse for workspace and we have some clients who get access to part of our source code.
If we use Lombok library, it doesn't get detected in Eclipse until the plugin is manually installed.
It's hard to send a communication to multiple clients and have them mandate the plugin installation.
Is there a way to automatically install a plugin from the project itself, may be with an yes/no question to let the users accept it, that way we don't get accused of sneaking stuff in :)
It is NOT possible to install an Eclipse plugin from the project itself.
It is clearly stated in the Lombok documentation that manual installation is necessary as Lombok is a preprocessor. Lombok needs to be installed to the Eclipse install folder (next to eclipse.ini). https://projectlombok.org/setup/eclipse
And I suppose it would be a security leak (both in Eclipse and your Customer's environment) if you are able to install something into the 'Program Files' folder from your projects without user interaction. However manually copying is feasible and could be a workaround if you are very keen to do so.
Workaround: You might provide an ANT/GRADLE script that will distribute you local copy of the lombok.jar into Eclipse's program folder. And also create a launcher configuration. So you can refer to this launcher step to be executed. Please note that you need to restart eclipse just after lombok installed. But in fact this is what lombok.jar does when running as described in the install guide.
The standard lombok installation is being done manually.
Therefore, I've created an automatic installer.
It's available here: https://github.com/zorik9/lombok-automatic-installer
Right now it supports only eclipse IDE in windows machine.
The idea is to configure once the variables: lombok_version, eclipse_home and workspace_dir (not mandatory)
And based on this configuration, run the installation script on each machine.
For more details, please read the readme.md file.

Use Intellij and netbeans at the same time in the same workspace

I was provided with a Ubuntu virtual box that has netbeans installed whereas locally I have Intellij. My Java workspace is shared between guest and host, therefore I was wondering if there will be any kind of conflict by running Intellij and Netbeans at the same time in such conditions.
Thank you for your help.
I am not sure how the guest-and-host-OSes condition would play into this but I am pretty sure otherwise that the workspace can be shared by both of them especially when they are not working on the same project. Even if they are, it'd be you who'd be getting confused as files would get updated on both IDEs as the other one makes any changes.
There should not be any conflict as long as you have read/write permissions on both the OSs.
However, to track the changes to code in a better way, use a version control system like subversion.
Also, do not copy the resources to your workspaces. Instead check out the code directly to your workspace.
This don't cause conflicts because each IDE adds a set of configuration files per project, for example: netbeans generates the nbproject folder, where is the project configuration for that IDE, while intellij generates a projectName.iml file and the .idea folder where is the configuration for the project.
If you use a version control tool as git, svn, mercurial, is recommended that you synchronize your project in each environment (guest and host) with your repository and do not share the workspace between them.

Import Java Project from Eclipse to NetBeans [duplicate]

Is there a way to share the same *.java files between Netbeans and Eclipse?
You can import an eclipse project into netbeans,
or you can create an eclipse project from existing sources.
Sharing the Java source files is not the problem - just put them into some source control system, and then import them in both IDEs. Usually the configuration, especially the build process, is the main problem.
In practice, the solution is likely that you maintain separate project configuration files for both IDEs, but use a common build script (e.g. ant) that is supported by both. The project configuration allows you to use IDE-specific features, while the build script makes sure that both environments produce the same output.
Of course. eclipse supports linked source folders. The sources files don't have to be located in an eclipse project folder.
Inside an eclipse java project, select New -> Folder, then select "Advanced" and check "Link to alternate location" (eclipse 3.6, may be slightly different on other eclipse versions). "Browse" to choose the source folder from the netbeans project, press Finish.
Now you have linked (standard) folder to the Java files inside the netbeans project and modifying those files will modify them at the remote location.
Finally - right-click on this linked folder and choose Build Path -> Use as source folder.
(I leave the other way round to the netbeans experts)
In the ideal case you have your code stored in a version controlled repository (SVN, CVS, etc.). Then it is not as big of a factor whether you are using Eclipse or Netbeans.
This article, taken from a NetBeans 6.2 version of documentation, explains how you can import an Eclipse project into NetBeans and work with both together. NetBeans will create new project files but will link to the Eclipse source files, allowing sharing between the two. I have not tried this yet myself, but may be going down this path soon. After switching to NetBeans just this week, noticed that a significant feature in Eclipse is not in NetBeans - that of being able to create different run configurations that are not incorporated and stored into the POM. At this point in time, I do not have a solution to the run configuration issue, but if you do, please update the SO question here.

jbpm don't know the jar file

I am the first time for JBPM. When I create object, the project do not know the jar file. Please help me.
The following is my step by step installation.
1.I installed the JBPM plugin in Eclipse Kepler.
2.I extract the jbpm-6.0.1.Final-installer-full.jar in D:
3.I create new projct in Eclipse.
4.After that they do not known jar file.
Please see my image.
Thank in advances.
You need to configure a jBPM runtime (point it to a folder containing the right version of the jBPM libraries you want to use) first.
I would recommend using the installer script to generate a fully preconfigured eclipse environment.
If you want to manually do this:
- unzip the -bin zip from jbpm-installer/lib to a folder
- in eclipse preferences, under jBPM, create a new jBPM runtime and point to the folder you just created
- restart eclipse for the changes to take effect

Importing .war file using cmd

I'm developing an Installer for a project team to reduce the amount of work they have to do installing it manually.
We are using:
Windows 7 x64,
Eclipse Kepler
Right now I'm looking for a way to import a .war file using the commandline.
Is there any way to do this via cmd?
First of all, I would not recommend importing the source code from a file in Eclipse if you have a team of developers, as you would be giving everyone a version that will hardly be actual after some days of work. Using some repository (CVS, SVN, GIT) would be the way to go.
If you have your code in a central repository, then you could make a "Project Set" file in Eclipse wich can be imported easily to setup your whole workspace:
http://help.eclipse.org/juno/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Ftasks%2Ftasks-cvs-project-set.htm
This project set might have instructions on how to construct the Workspace based on checkouts of the repositories you need.
If you happen to work at a company that uses some X or Y old-fashioned Source Control tool (or worse, none at all), and you have no chances of implementing one that is compatible with Eclipse (like the three I stated above), then the time you are saving with automating the import of a war file will become irrelevant compared to the source code control issues you will be facing (or the team is facing already).
A WAR file is a ZIP file. If you need the content of the WAR you can use the tools for ZIP archives.
A workaround in case eclipse does not have any such options would be to
do a Import WAR through eclipse GUI
check what changes are made to workspace by eclipse (eg. folder created with exploded war file content, configuration files created by eclipse in the folder like .classpath for project folders etc)
Identify the steps and replicate the same through a batch file
Add a call to the batch file in eclipse launch short cut
There is no command line API I know to do this task for Eclipse just from command line, but with the right tools you can achieve what you want.
Please try this:
Straightforward approach that works with any GUI application. You can use AutoIt scripts for interaction with any application. The downside is that GUI may change more frequently than command line API.
Try to create Eclipse project with metadata and unpack WAR file in this project. It can be done, for instance, with Maven or Gradle. Those also can download all dependencies for you.

Categories