I'm currently working on a groupproject. We're using github to save our code. I have just installed eclipse to work on. I foound to open the project to use import. This has opened the project, except the SRC folder is empty whereas the first SRC folder (the main which was made through github) has several .java files within.
Why is this and how do I go about putting them in. I am unable to work on the code through eclipse at the moment due to this. Thank you, much appreciated.
The easiest way would be to:
clone manually the GitHub repo (in command line)
import the Eclipse project in your Eclipse workpace
Then push to the GitHub repo
Or you can clone the GitHub project through Egit directly,, following this tutorial.
The OP pokeairguy reports in the comments an alternative solution:
create a new project in eclipse like normal.
Then drag the contents of the src folder from GitHub into the folder directory within eclipse.
Then selecting link in the pop up window.
I think it works by thinking its a new project but saves everyone done under the GitHub folder, for GitHub to work.
Related
Edit: The solution to the problem was to uninstall and re-download and install intelliJ.
I am unable to create a class following online tutorials. One method is to expand the project folder and right click src and from there you can create a class, but I am unable to expand the project folder in intellij and therefore am unable to access the src file to create a class. The tutorial video shows an arrow next to the project that you can click to expand the project, but I don't have this arrow. Please help I am new.intellijScreenshot
This is the tutorial I used: https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-application.html
I created the SRC folder like someone suggested and now the project expands, but there still is no option to create a class.
This has to be an issue in the way the project was setup. When you create a new project, IJ creates three things in your project, a src folder, a .idea folder, and a .iml file. Without the .idea folder and .iml file it wouldn't let me create a new class either. Delete your HelloWorld project, and try again. If still no luck, maybe try uninstalling/ reinstalling. Could possibly be an issue with the JDK, I don't mess with that, I just use 11 version 11.0.6.... Hope this helps!
It is the first time i am trying to checkout someone else code from github.
I have downloaded the jar
https://github.com/wittawatj/jtcc
However, there is only a src folder which i am unsure of how to insert it into netbeans or ecplise without having to rename all the packages and classes.
I believe there is some shorter way.
I would like to edit the Java code like its my own source code where I could make some tweaks to it
I have just tried it on my machine with git clone https://github.com/wittawatj/jtcc and everything got downloaded, are you sure you are using the right git commands?
For NetBeans you can directly clone the source repository from within NetBeans:
Use Team -> Git -> Close to checkout the source code from GitHub and supply the necessary information in the following dialog:
In the final page of the wizard you can enable the "Scan for NetBeans project" option:
As the project does not contain a NetBeans project, NetBeans will prompt you to create a new project after the code has been downloaded:
Use the option "Java Project with existing sources" to setup the NetBeans project with the sources from GitHub.
Details on setting up a project in NetBeans can be found in the manual:
http://docs.oracle.com/cd/E50453_01/doc.80/e50452/create_japps.htm#BABCGJJB
I have been working on a project locally and at some point I gave the project to someone else to work on.
Since that time, I have created another package with classes and so on in my own project version. Since I want the other person to have this package, I gave him the package folder which he copied in the path ProjectName/src/packageName.
Of course, he didn't see it right away, so I used New->Source Folder and refresh/clean/pray to make it work.
The question is: is there some other way to add packages to projects? as I'm not sure this is the right solution.
A refresh is sufficient after you have dropped the new source files inside the source folder. No need to add a new source folder.
The clean way to collaborate is to use a version control system, like Subversion, git, or whatever. Copying files between developers is a recipe for chaos.
From backend, Go to ProjectName/src and copy/paste all the package, and then right click and select "Refresh".
Simply dropping in the files and refreshing is sufficient. Eclipse will automatically ammend the package declaration in the Java sources.
That all being said, you should be looking at using a version control system such as CVS or subversion for example.
Copy the folder at desired location.
Refresh the project in eclipse. It will be visible now.
Right click on the folder in eclipse under project explorer. Select Build path>Use as source folder.
I have a project whose source code is hosted in svn and I have checked out the source code already say in a folder "myfolder". The directory structure of my code is as follows:
myfolder/trunk/src/ is where my code resides. Now I create a Java project using eclipse using File -> new java project with the location to be myfolder/trunk/src/. When I do this, all the package structure gets changes and I have errors in my sources files.
It would be great if somebody can tell me what is the correct way to do this. I have found some articles on the internet, but the more I read the more I get confused.
Thanks
Vandana
You should have probably chosen to Import Existing Project into your workspace and you should try that instead. It works great as long as you have your .project file defined. To fix the errors you have now, Create a new src folder in your project and point it at trunk\src, so that it correctly recognizes all your Java files.
You probably should use myfolder\trunk as the root of your project, rather than myfolder\trunk\src. As Perception has mentioned, try to "Import Existing Project" first (rather than start a new project and point it at your source).
First, I assume you already have subversive/subclipse plugin installed in your Eclipse and you have used the right URL to import your source code.
Before checkout your source code, you may change your perspective to Java perspective.
Then you only need to use File-Import-SVN(choose SVN as your import source)-Checkout projects from SVN-Next-Give your project a Name-Finish.
If you have problem about installing SVN plugin, reference is http://subclipse.tigris.org/
http://www.eclipse.org/epsilon/doc/articles/epsilon-source-svn/
I created a NetBeans project. I took the project folders zipped to another machine and tried opening it in NetBeans. NetBeans didn't identify it as a NetBeans project. I have transfered projects in this way before but why is it not working now? Are any of my project files corrupted. Is there any way to retrieve my files from this?
Try using create new project from existing resources. This may solve the issue.
I just copied whole project into place in system where NetBeans stores projects (in windows it's user\username\Documents\NetBeansProjects\ by default), then started NetBeans and voila - worked great :)
You can try this:
Create a new project on the target machine
Find where the project you want to open is stored and open the src folder.
Copy all the files and stuff in the /src folder
Go on Netbeans, expand the tree view of the project you have just created, right click on source packages and click paste. It should paste the files in the /src folder as packages. You should also see the code these packages contain.
I discovered this solution and it worked for me: http://netbeans-org.1045718.n5.nabble.com/Netbeans-Crashes-Since-Windows-Update-td5752603.html
The fix is to remove the GodMode shortcut that may have been created on your Desktop or on the root of the %systemdrive%.