Problems with libgdx libraries using intellij on a git project with a friend - intellij-idea

So I am fairly new to programming, and new to git, LibGDX and Intellij.
My friend and I started with a programming project a few days ago, where we generated a project using libGDX. We opened the project in IntellIj IDEA and sat up the run command. It worked on my friends laptop, but when he pushed it to git and I cloned it, it didn't work. So I dived into settings and looked at differences between my own project and this shared project.
What I found out was that all the external libraries was gone for me. So I checked the project structure and found that all the paths were specified to his computer.
For example:
/home/"name"/.gradle/caches/modules-2/files-2.1/com.badlogicgames.gdx/gdx/1.9.3/1a3775429980a6c8da0cdefb656ad1dabf91d629/gdx-1.9.3.jar
So I tried changing the paths to ~/.gradle (...).jar but it automatically expanded the path to the full path of my computer instead. So the question is:
Is it possible to set the project structure settings for modules to an universal path that works for everyone cloning the project, or do I have to add every path individually for each person working on the project?
Thanks,
Jon

While it is safe to add the .iml files and most of the .idea directory to your git repository, you should avoid adding the following files:
.idea/workspace.xml
.idea/libraries/*
See this documentation for more details.
Since it's a gradle project, IntelliJ should reimport the gradle model automatically and create these files with paths that depend on your own environment.

Related

Cannot add framework support in IntelliJ 14 Ultimate

I found a pretty old post with this question but unfortunately he didn't get any help. I hope someone can assist me.
I created a repo at GitHub. After cloning it to my computer I tried to add the following framework support: Maven, JSF, EJB, CDI, etc. I know I could add the files manually. But, I want to use what the IDE has to offer.
However, the only framework showing up is SQL, which is different from this post from stackoverflow and from their documentation.
Has anyone had this same problem and got it working?
Intellij reacts to changes in your Maven pom.xml file. Maven does not react to changes in your IntelliJ project module settings.
The steps that you should follow here are
Close IntelliJ
In a command shell, clone your Github repository.
Using an editor external to IntelliJ such as VI or Notepad, create a pom.xml in the root directory. Better yet, use a Maven Archetype to generate your pom.xml.
Now open IntelliJ. Choose File, New, Project From Existing Sources. Navigate to your pom.xml and follow the prompts.
I recommend checking Search for projects recursively and Import Maven projects automatically.
Finish the project creation.
Now, add dependencies to your pom.xml via the dependencies tag. See Maven Dependencies. Intellij will automatically react to dependencies that you add as long as it can see a Maven Repository on your local machine or on your network or on the Internet.
I know it is a little bit to late but I just post it because it is still an possible issue: You need to open YourProjectName.iml and make sure that the type (<module type="JAVA_MODULE" version="4">) is JAVA_MODULE and not something else!(In my case it was WEB_MODULE)

Intellij plugin development, SDK source file content

I can't figure out how to add the Intellij SDK plugin development source files to be able to navigate the files.
Right now I am only getting a decompiled list. I'd like the comments as well.
Note, I know there is https://github.com/JetBrains/intellij-community/blob/master/platform/platform-impl/src/com/intellij/openapi/editor/actions/
But shouldn't these already be included?
Can someone explain how to add the sources? I tried from module settings but couldn't get that to work.
If you're developing a plugin, or viewing/modifying an existing one, I suggest you take a look at the IntelliJ SDK docs, especially the prerequisites section, which explains how to set up a proper development environment.
Basically, you should clone IntelliJ community using
git clone git://git.jetbrains.org/idea/community.git idea
Then configure an IntelliJ SDK, and in the Sourcepath tab, add the local git repo to attach the source code.

netbeans 7.3 add git to project

I have multiple projects in netbeans. Some of these projects are version controlled using cvs and others using git. When I change something in the project that is using git, a .cvsignore file is created automatically. But I don't want the project to use git.
Secondly, I created the project in netbeans and then went to terminal and did a git init. There is no term/version control decoration on the project but when I do a team -> git -> initialize, netbeans says that "Selected file is already part of a Git repository.". Is this a bug?
It's not a bug. That means someone already added your project to Git. (At least tried).
If you want to get rid and add your project to your own Git repo , search for .git files inside the project and delete them.
After that start the process again.

Play Framework 2.1 application mounted as an IntelliJ Module

Known is the command to create IntelliJ files needed for a Play application:
play idea with-sources=yes
This generates two folders:
.idea (containing libraries.xml)
.idea_modules
Most of tutorials or simple article on the net explain how to mount the app as an IntelliJ Project.
However, I want to mount it as a Module (as part of an existing project so), thus I've just used the .idea_modules file.
I can't imagine me setting ALL dependencies (more than 100...) manually...
How to deal with the libraries (dependencies)? Indeed, libraries.xml is used in .idea file and typically used when someone want to mount the app as an entire Project.
To put in a nutshell, is there an efficient way to set up a Play app in IntelliJ as a simple Module including automatically all needed dependencies?
It would be great if IntelliJ could implement an SBT feature like the one for Maven in order to import dependencies automatically.

intelliJ 11.1.4 - adding a jar to project only works 50%

I have an Android project that uses some external libraries. The problem is that within intelliJ I can build the project and it runs fine, but the editor marks classes that come from the jars as unknown.
I've added the jars to the correct module (project structure -> module -> dependency) independently, from the libs directory, as classes, jar directory, etc. I've also tried to add them using project settings -> add libs, attach them to the module. But to no avail. I also tried to add them within the project explorer with right-click -> add library. Nothing works.
It was all fine before but now after a horrible IntelliJ crash it no longer works. This has happened to me twice now. And I loose a lot of time trying to fix this. Am I fighting an intelliJ bug here?
File | Invalidate Caches is the first thing to try in similar cases.