Setup Minecraft Forge to create mod in eclipse - eclipse

I'm trying to make a mod in minecraft (1.12.x) in eclipse, but i'm having a lot of problems with it. Many I managed to solve them but this problem not:
Unresolved dependency: net.minecraftforge:forge:1.12.2-14.23.5.2859_mapped_snapshot_20171013-1.12
The error is with build.gradle in line 0. I didn't change anything inside the file path.
Anyone can help me?

Assuming you have git installed:
Clone the Minecraft Forge Github repository
git clone https://github.com/MinecraftForge/MinecraftForge.git
Import project into eclipse
In eclipse, go to File --> Import.
In the Import wizard, select "Existing Projects into Workspace" and click Next.
In the "Select root directory" field, browse to the directory where you cloned the Minecraft Forge repository.
Eclipse should automatically detect the Minecraft Forge project. If it does not, you can manually select it by clicking "Browse" and navigating to the "build" directory within the Minecraft Forge repository.
Click "Finish" to import the project into Eclipse.
Setting up minecraft
Right-click on the Minecraft Forge project in the Package Explorer and select "Properties".
In the Properties window, go to "Java Build Path" and click on the "Libraries" tab.
Click on the "Add External JARs" button and navigate to the "lib" directory within the Minecraft Forge repository.
Select all of the JAR files in the "lib" directory and click "Open".
Click "OK" to close the Properties window.
Running Minecraft
Right-click on the Minecraft Forge project in the Package Explorer and select "Run As --> Java Application".
Eclipse will build and run the Minecraft Forge project.
For this guide, I am assuming that you have everything like JDKs configured correctly.

Related

Importing project from a local git repository into the Eclipse Project Explorer not working

I cloned the following project from GitHub to the git view in eclipse:
https://github.com/nfrankel/twaattin
I want to have the project in my Project Explorer so I can work on it and run it (for testing purposes).
To this end, I went to the Project Explorer and did the following:
I clicked on "File"
I clicked on "Import"
I clicked on "Git" -> "Projects from Git"
I clicked on "Existing lock repository" -> "twaattin"
I chose "Import using the New Project wizard"
I clicked on "Finish"
Then the following window popped up:
I chose "Vaadin 8 Project" and clicked "Next"
The following was displayed:
I chose the first option and clicked "Next"
On the next page I changed the Artifact id to "Twaattin" and clicked "Finish"
The structure of the project I wanted to import is the following:
But this was not imported to the Project Explorer. What I got instead was the following:
So I tried an alternative way ...
I repeated steps 1 to 4 from above but then in step 5 I chose "Import as general project".
After I clicked "Finish", the project became visible in the Project Explorer with its correct structure and I thought everything was fine.
However, now I got the following problem:
when I go to the Servers tab and right-click on my tomcat server and then choose "add and remove" from the menu, the imported project is not addable to the server so can't run it !!
The only projects that I could add to the tomcat server are two old projects I did not import from git but created within the project explorer.
Here's a screenshot:
As you can see the imported project (whose name is "Twaattin") is not amor the addable projects.
So my question is this:
How can I import a project from a local git repository into the Eclipse Project Explorer in a way that it can also be added to the tomcat server ?

github project not launching as web app inside eclipse

I have eclipse mars installed with the egit plugin. It successfully downloads projects from github, but how do I convert the downloaded github projects into eclipse maven web projects that can successfully launch via Run As ... Run on server in eclipse?
Let's take this two step authentication project on github as an example. How do I get this project to launch from eclipse using Run As.. Run on server?
Here are the steps I took so far:
1.) Right click on white background of eclipse Project Explorer.
2.) Choose Import > Import ...
3.) Select Git > Projects from git from the resulting dialog box
Click Next
4.) Select Clone URI then click next again
5.) Enter the following in the URI field: https://github.com/kyleboon/two-step-authentication-example
6.) Click Next
7.) Click Next Again
8.) Click Next a Third time
9.) Select Import using the new project wizard. Then click next again.
10.) Select maven project and import
11.) Right click on root of resulting project in eclipse Project Explorer and choose Properties.
12.) Select Project Facets
13.) Enable Project Facets
14.) Select Dynamic Web Module to make it a dynamic web project. Click OK.
15.) Right click on project root in eclipse Project Explorer. Select Maven download sources, then Maven update project.
16.) Right click on project root in eclipse and choose Run As...Run on server
The result is that tomcat gives a 404 error when it launches the following url: http://localhost:8080/two-step-authentication-example/
So what steps do I do instead in order to successfully launch this specific github project in eclipse using Run As...Run on Server? This question is general for all github web projects, but we are using this specific project as a case study to test a method that will be repeatable for other github projects.

Can't run project in Eclipse imported from Git

I have a project in my Eclipse workspace from Github (via File -> Import -> Projects from GIT).
However, I am unable to run the example because the only option I have under "Run As" is "Run Configurations."
After going to "Run Configurations" I click "browse" and the project that I imported from GIT isn't there.
Any ideas?
The question is already answered in the comments but I am providing this answer to possibly clear up some misunderstandings.
In order to recognize a folder as a (Java) project, Eclipse needs to read (or create) a few files for each project, like .project and .classpath. If you do not have them in your project, or do no create them during the import, then Eclipse just imports it as a resource, or a dumb folder.
If your project is tracked by git and is also a maven project, you can clone it locally with Git (command line or GUI tool) and then "Import as existing Maven project" in Eclipse. This will use your pom.xml to create the two files mentioned above and your project will be buildable.
Alternatively, if you have already imported it as you described in your question, you can right click on your project on Package Explorer and choose Configure-->Convert to Maven Project. This will create the .project and allow you to build the project using Maven (right click->Run as..-> Maven build) and Eclipse's incremental builder (where necessary). If your maven project builds an executable, the option to execute it will also be available in the Run as.. menu.
If you have a more complex maven project (like an aggregate pom), and want a Run Configuration that runs a specific program, you will have to write it yourself by opening the Run Configurations window and explicitly referencing the java class.
Don't import the project using git clone. Download it as zip file and extract it. Add it using Project>import> General> Projects from folder and Archive.
Provide path of extracted folder into import source and finish and go to eclipse and clean and build safely run and right click on project and run it.
It should work

Eclipse add source files to package explorer

I checked out a Maven project folder from SVN. It is coming up as folders in the Package Explorer, and when I right click -> Build Path -> no actions available.
Is there anyway to add the source folder to appear as a package?
The project is not set up as an Java or Maven project inside Eclipse. You can apply the Maven and Java nature afterwards in the project properties, you could run mvn eclipse:eclipse outside of Eclipse and import the created Eclipse project into your workspace (it could even exist as option in the project's context menu under "Maven", depending on how the project is setup right now).
Or, much easier, you just checkout a Maven project from SVN. Within the "New Project..." dialog there should be an option "Maven > Check Out Maven Projects from SVN". Then it will be configured automatically.

How to checkout maven project from svn repository

I am new to Maven and Eclipse, I need to check out an existing Maven project from a SVN repository. I have installed the M2E plugin and the subversion plugin and they seem to be working properly. Here are the Installation Details -->
When I right click in the project explorer and select Import -> SVN -> Project from SVN, then select the repository location and click finish, I am prompted with 4 possibilities
What is the procedure for checking out a Maven Project from this point on, or am I on the right track here?
Thanks for your help in advance!
tl;dr : Check out this video. The portion between 1:04 and 1:50 should answer your question (To skip to the interesting part, click on the youtube player and press 4).
You already have the SVN connector for m2e installed. Thus it should be possible to Import Existing Maven Project from the SVN repository.
From the options you have listed in the above snapshot, you should be able to proceed after selecting the First or the Fourth option i.e. :
(according to Mauno V's suggestion below) To convert this imported project into a Maven project Right Click on it and do a Configure -> Convert to a Maven Project like so :
If you have Pom project as a root branch, after project checkout completed, you may do it with import project as 'Existing Maven Project' and set the project as root project, and finish!
you should be able to see your module define as project in eclipse project explore, and eclipse will recognized as module project.
do right-click on Pom project, Maven -> Update Project or Alt+f5 to refresh and see the content project.