I have lib.userlibraries file with the following content:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<eclipse-userlibraries version="2">
<library name="MyLib" systemlibrary="false">
<archive path=PATH_TO_LOCAL_JAR_1/>
<archive path=PATH_TO_LOCAL_JAR_2/>
...
<archive path=PATH_TO_LOCAL_JAR_100/>
</library>
</eclipse-userlibraries>
I want to import these local jar files to the project in IntelliJ Idea. I can do it manually via File -> Project Structure... -> Libraries, but it will require to import each jar file separately. Is there automatic way to import this userlibraries file to IntelliJ Idea project?
The other answer about using the IntelliJ import feature for eclipse projects should be your first "stop".
Beyond that: importing doesn't necessarily work for all projects. We have a large, complicated eclipse project. Trying to import that in IntelliJ simply didn't work (the module definition that IntelliJ created was completely wrong, and lead to thousands and thousands of build errors).
In that specific case, it might be faster to use a powerful text editor, like:
open the eclipse .classpath file
create a new IntelliJ project, and import maybe one of the required libraries manually
open the corresponding module xyz.iml file
simply compare/copy ( get the JAR file names from eclipse, and use editor magic to create the raw strings you need for the .iml file )
Of course, that seems silly, but as said: using a text editor, I got a large setup with 15 modules/projects to build fine in less than an hour.
And the real answer: base your project setup on a tool like maven or gradle. Because these tools allow you to generate eclipse or IntelliJ configuration files. If possible, always do that. Even when it means to learn a new tool, and a lengthy transition period.
In IntelliJ IDEA open the Eclipse project by importing from Eclipse wizard. It will give you an opportunity to select user libraries.
Related
I want to import a maven project from GitHub into intellij which in of itself I know how to do however, the project this time was created initially also as an eclipse project and I want to be able to work on it in idea while my team members work on it in eclipse without causing conflicts due to differing project file structures. How can this be done?
When checking it out in Intellij it does ask me if I want to create a project from it and select yes but next, it asks whether to create the project from the existing sources vs from external model. From the external model option it allows me to pick eclipse or maven but not both. Do I just create from existing sources? Which is my best option to do this without screwing it up for the others when I commit and push my changes?
I understand that the easy answer might be: "just use eclipse" however, I think the answer on how to properly do this could be useful later. Not only me but also for others who want to work with the IDE they are most familiar and productive with and not mess with the workflow.
Any help would be appreciated
When importing an Eclipse project into IntelliJ, you have the option to:
Create module files near .classpath files
Keep project and module files in
The idea is to keep your *.iml file concurrently with your Eclipse .project/.classpath (and you can keep them in sync).
That way, you can open the project in both IDE.
I'm trying to make a small java program revolving around Google Calendars. I've never worked with java before but I was able to get Google's sample code working. In Eclipse, I simply used Import -> Maven, and then made some small changes to the code so that it worked on my Calendar.
Ok, great, now I want to write my own code. I started a new project and imported the Google Calendar API. At the very beginning, there are several import actions:
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.extensions.java6.auth.oauth2.AuthorizationCodeInstalledApp;
import com.google.api.client.extensions.jetty.auth.oauth2.LocalServerReceiver;
import com.google.api.client.googleapis.auth.oauth2.GoogleAuthorizationCodeFlow;
.
.
.
It turns out that I'm missing the second and third files. How do I find these files and how to do import them to the new project?
Please note: I ultimately don't want to rely on importing the Google Calendar API or anything similar, as I will be using another non-java program to run and control this one.
Here's what I tried:
I go back to the sample code, expand Maven Dependencies and find:
google-oauth-client-jetty-1.19.0.jar
google-oauth-client-java6-1.19.0.jar
I see that these files are in:
C:\******\.m2\repository\com\google\oauth-client\google-oauth-client-jetty\1.19.0
C:\******\.m2\repository\com\google\oauth-client\google-oauth-client-java6\1.19.0
I tried to add these with Import -> Java EE -> App Client JAR file
Didn't work, do I need to change the file name or import name? Maybe these aren't the correct files anyway.
I also tried to add these by creating a lib folder in my project folder and add the JAR files directly there.
I guess from your question your project is just an Eclipse project rather than a Maven project. Obviously Maven automatically add the required jars of the dependencies stated in pom.xml for example google-oauth-client-java6-1.19.0.jar is a dependency of google-oauth-client-jetty-1.19.0.jar.
To add external jar to your project in Eclipse you need to select the project then from the Project menu select Properties. On the properties popup click on the Java Build Path, you have two options depending where the jars are stored, if you are referring to the maven .m2 directory then choose 'Add External Jars' otherwise if you added them to a lib folder in the project choose Add Jars
I used Eclipse PDT (Kepler with PDT 3.2.0) as my main IDE and there is something I could find how to do.
I'm working on a big Zend application, with a couple of hundreds of modules on it. To make it easier to code, I add to Eclipse each of these modules as a separate project. They are also logically arranged on Working Sets.
I would like to make it so that the classes of all of the open projects on the workspace appear as code completion automatically on the other projects. Right now it only recognizes the classes on that same module, or I have to create a library based on the local folder and manually add to each project, which makes building very slow.
I am not aware of a setting that can solve this, but there is some other options.
You can add the bin folder for each project to the build path: Project preferences -> Java Build Path -> Libraries -> Add Class Folder. This is a painstakingly slow process to do through the gui, so you might want to add the line <classpathentry kind="lib" path="/NAME_OF_PROJECT/bin"/> to the .classpath file - one line for each project - and work some copy-paste.
If you add new modules relatively often, you might want to automatize this. You could of-course write some hack-script that modifies the .classpath file, but a more proper way will be to create your own classpath container. Take a look at this blog post, that describes how to create one. You should be able to get it working in less than a day, if you have experience with Plugin development.
I have download entire Eclipse Helios/Indigo version Source Code. Now I want to work on it like some modifications and all. So I imported the entire sourceCode but now I am getting n number of errors while compiling. Moreover I am trying to RunAs> Plug-in is confusing me about the output I am getting is the changed one or what.
My Problems are-
How to import entire Eclipse SOurceCode in eclipse?
How to build the Eclipse SourceCode properly?
After modification in the SC of Eclipse , how to check the changes feasility?
I would define a target definition for your Eclipse distribution. Include all the features (including source) in the definition. Then you can use you importer to import plugins from your target definition into your workspace with sources and work from that. Having target definition is easier because you can change your setup on-demand.
Edit: Forgot to mention that in import wizard (File -> Import -> Plug-in Development -> Plug-ins and Fragments) make sure you select "Project with source folders" under "Import as". Otherwise class files will be imported as jars and not deflated into your project. Just makes it easier to work with them this way.
I need to import a existing Web Application , into Eclipse .
Please see the Structure of my Web Application as shown in the below figure .
http://imageshack.us/f/220/structurek.jpg/
From Eclipse IDE , while using import What option i need to select that is should i use
Existing projects into Eclipse
Archive File
File System
please see this image
http://imageshack.us/f/850/eclipseo.jpg/
Import existing projects into Eclipse works only for projects that were created in Eclipse.
And you're definitely not dealing with an Archive File here.
Import from the File System just copies the resources but does not actually create an Eclipse project for you.
What I would advise you, is to create a new Dynamic Web Project, configuring all the required facets, and then just copy all the contents of your existing app to the WebContent folder, either by drag'n'dropping it into the Project Explorer or by using Import from the File System, overwriting all the contents.
So far, there seems to be no other way to do it in Eclipse. However you may check out the similar post. The user #RC recommends using ant task for this process, but I'm more than sure that it won't configure all the required facets for you. It may work for some simple Java projects, but surely not enough for Java EE projects.