I am using Eclipse to develop a Java program. If I want to share the code (Java files) with someone else (who is also using Eclipse), what would be the easiest way? We do not have a source repository set up yet.
You can send them the example.java files via email or Skype and they could add them to their project if you wanted to go old school.
I think a repository like Github or Subversion will be your best bet.
I vote for setting up a repository :)
I would strongly suggest to consider setting up a source repository for your usage. Meanwhile, you can try something like this:
Export your project files: (After selecting your project), File > Export > General > Archive File
The import option works almost in the same way.
TortoiseSVN is a free subversion tool you and your friend can download.
http://tortoisesvn.net/
It would be most beneficial if you went ahead and set up your repository now, rather than later, especially since you are both interested in starting development.
Related
I am (finally) in the progress of migrating a svn repository to git. Transforming the repo itself was not much of a problem, but I cannot make Eclipse play well with the result. (I am kinda new to git, btw).
The repo contains amongst lots(!) of other things a subdirectory with java code which I would like to use in Eclipse as the base directory of a project. The SVN plugin offered a wizard I could use (New > Other > SVN > Checkout Projects from SVN > svn://host/repo/subdir), but the Git plugin does not seem to offer such kind of workflow. Its import only allows for repository roots to be entered.
Is there a way to make git do my bidding
without ripping my repo into subrepositories
without creating some kind of git-svn proxy
by somehow connect the project to the repo after creation?
Does anyone have any ideas?
I am running Eclipse 12/2022, Git Integration 6.4.0, Subclipse 4.3
As you are migrating from SVN to GIT personally I strongly suggest you to change also way of working to use GIT in a more efficient way. So I think that you should consider if it's worth to split it into separate repositories (which is my suggestion).
It's like with a mobile phone and a smartphone. It's hard to change standard mobile phone and replace it with a new smartphone without changing your habits and way how you are going to use it, right? Or similar with migration from Windows to MacOS. It's hard to switch to MacOS and use it like it's a Windows system.
However if you are still stick to SVN way of work please read about sparse-checkout:
https://stackoverflow.com/a/13738951/9983181
https://stackoverflow.com/a/2303645/9983181
and git submodules:
https://git-scm.com/book/en/v2/Git-Tools-Submodules
I have a laptop and a desktop. I prefer using my desktop when I am at home working with my school projects.
If I upload everything on GitHub with my laptop and I'm using Eclipse or Intellij, do I need to use the same IDE/IDEA to continue working on my projects at home?
No you don't need to use the same IDE. But be careful, different ide's have different files that should not go to git. IntelliJ produces .iml files and Eclipse produce .project files. Some other files might also exist and you may not want them to go git. So, you need to define your .gitignore files carefully and you are good to go.
Unless you decide to upload IDE specific configurations into your source control, or if you don't use something like Maven or Gradle to manage your source dependencies, it won't matter.
IDE has nothing to do with your code or the machine you use, there are many IDEs you can choose from based on your personal preferences like visual-studio, Atom, sublime, notepad++ e.t.c. sure few people associate an IDE with particular language/framework, then again there is no standard for this, everyone has there own preference.
You do not need to use same IDE. The two you mentioned has property of connecting git so you can just go as you want. Just import your projects from git.
I am an enthusiast attempting to play around and add things to an app that I have been using for the past year which the source codes are available in GitHub. Problem is when I clone or download the repository and open it in Eclipse, I get a ton of error codes whenever I try to 'run as' Java app (in particular I am unable to find the 'main class/starting point' there's way too many files to chose from to find it and most don't work) and when I try to extract the files to an executable jar it gives me a JAR exe that is unusable :-(. I know that the files are workable since I do use the executable jar that is available from the developer and others have also toyed around with the source codes.
Can anyone assist me with this? Maybe I am using the wrong Java manipulator/application. The program I am using for opening these files is Eclipse IDE for Java Developers and my operating system is 64bit Windows 10.
Also, here is the GitHub URL for the repository, in case anyone asks: https://github.com/DraqueT/PolyGlot.
I thank anyone who can be of some assistance as I have been working on this forever and can't seem to find a solution.
The github project looks a lot like a utility library than a full application. But the following could help:
Try to study the README file attached to the github project. (There is one in the source code according to the author). This would help you to setup the project.
Make sure to download all the dependencies for that project. Again, the author has provided some of them in the github project (I could see some Apache POI libraries in there somewhere), but getting the required jars on the maven repository isn't that difficult.
It would also help to know what type of project it is. For example, having a main method in a web application doesn't do much for you, but a Java SE project would need a main method to run. So try to find out what kind of project it is.
If all else fails, you could try to contact the owner of the repository or one of its contributors to assist you.
Cheers!
I have two computers, and want to share a java project in eclipse by saving and opening the project from my USB stick.
But I can't seem to get it to work very easily.
What steps do I need to take to set this up properly?
These things should be discouraged. My advice is using an SCM (Source Control Management)
like Git and keep a repository on the external drive (if using Git, a bare repository on the USB stick and a local repository on each machine). At the beginning you'll spend quite some time getting used to, but it will pay soon (you'll have descriptive changelogs and disaster recovery facilities)
Eclipse has support for Git via Egit, and for SVN builtin.
When you share a project like this, you may encounter troubles related to classpath references to external JARs, which may be overcome by
using a lib/ folder (thus keeping the JARs under version control)
using an environment variable like $JAVA_LIB
using some dependency manager like Maven or Ivy (again, there are lots of stuff, but will pay even in the short term)
For existing project that you don't want to put under version control, you can simply (again, there may be missing library errors) use the menu File > Import > General > Existing projects into workspace
I strongly recommend using a cvs, svn, or other version control repository for this purpose. Trying to manage it manually is eventually going to bite you.
But if you insist, the best way I know of is to create the project in Eclipse by un-selecting the Use Default Location option in the New Java Project wizard. That allows you to specify an external location for the project contents, in your case the USB drive. You'll have to make sure of a few things:
that the USB drive is always plugged in while Eclipse is running.
Refresh the entire Project each time you move the USB drive from one computer to the other.
Any references to JARs are either internal to the project (eg, in a /lib folder inside the project) or use Classpath Variables.
It's going to be quite tedious, which is why it's always recommended to not try this and use a version control repository instead.
I do this. With some projects I have in SVN or GIT. For me it's more important to have only one eclipse and one workspace. Unfortunately this limits to Windows (or one os). The trick is to ensure that it always has the same drive letter. I tried with subst first, but I forgot to often. But using the drive manager from Windows everything works fine.
Can me and my other friend programmer work on same project with Eclipse synchronizing it, or we need to share the src every 10 minutes?
You can certainly use the "Team" menu, which gives you access to version control systems. I would recommend Git or Mercurial (Distributed Version Control Systems).
EGit/JGit are now part of the mainstream plugins: you can install them using the "Indigo" repository (assuming Eclipse 3.7) in "Install new software...".
Centralised Version Control Systems (like CVS or SVN) also have plugins for Eclipse. They might, however, make it more difficult to branch and merge conflicts when required.
You are looking for a version control system (VCS) like CVS, SVN, Git, Mercurial, etc.
It seems like you are asking if Eclipse has support for sharing workspaces so that you and your friend can (in essence) cooperatively edit and run the same set of java files in real time.
Something like this - http://www.readwriteweb.com/cloud/2011/07/cloud9s-web-based-real-time-co.php
The answer is No. Eclipse doesn't support this directly.
However, there is an Eclipse plugin / project called Saros that claims to do this. And the Saros site has links to related projects that may be relevant.
(FYI - the relevant search terms are "collaborative programming".)
This is what you need:
http://en.wikipedia.org/wiki/Revision_control
SVN or CVS - kind of version controlling system will help u to work together or u want to maintain your repository online then kindly check out https://stackoverflow.com/questions/59791/free-online-private-svn-repositories link.
I use SVN Notifier which sits in the system tray and notifies me every time the repository changes. And I can highly recommend it. It means you only update when there's something to update!
Alternatively you can set up a scheduled task/cron job to run svn update in the appropriate directory every hour/day/whatever.
refer this Microsoft article on setting up a scheduled task.
You want a batch file called svnUpdate.bat or something which looks like this:
cd C:/path/to/your/working/copy
svn update
Get the scheduled task to run this as often as you like (once an hour seems sensible)
Make sure you have the command line version of svn installed (I use SlikSvn) and available on your PATH (in a command window type svn and ensure it says 'Type svn help...' or similar.