How to Group Programming cross Internet - java

Alright, me and a few others are looking to work on a project together, and we have our own VPS to host the server as it runs, but the problem is that we need to be able to access the source at the same time to edit things; now I'm wondering if there's some sort of way to set it up via FTP or something, and if so, what if we were to unknowingly access and save the same file, it would cause loss of data.
How can a few people and I access a source project hosted on a server at once without loss of data? To clarify, we're using Netbeans as our IDE, and it is a Java project, JDK 8, contains anything from text files, to image files, to java source files, so it can't restrict file types.

The universal way to work on a codebase as a group is through a version control system. Version control systems allow for the merging of code to prevent data loss and give you full line-by-line history of your project. Git is probably the defacto at this point in time, and loads of sites will let you host Git repositories for free.
GitHub is one of the most widely used Git repository hosts. They offer free hosting for open-source ("public") repositories.
BitBucket is another monster, and they offer free hosting for both open and closed source repositories.
You can find many others with a simple web search. GitLab supposedly allows you to setup a simple local repository which may be what you're looking for.
You can refer to the Using Git Support in NetBeans article to get started.

Related

How to share work space in eclipse?

I have following problem:
3 people are working on the same Java project and want to share a workspace so we can all work together. Our computers are connected to a local network, but we want to share the workspace created in one computer.
Git is currently the standard tool to use in this case. There are others but I would recommend using it over anything else. It is also free.
http://git-scm.com/
After downloading and installing on each of your machines create a public repository to store the project.
Here is the getting started page:
http://git-scm.com/book/en/v2/Getting-Started-About-Version-Control
Multiple Eclipse instances would NOT run well on the same "physical" files. Eclipse does not even reload directories when there are modifications. This means, you get trouble if you sync the filesystems.
The best way to work together and share the code is to use some kind of revision control system, i.e:
git
SVN
Mercurial
I would look into setting up some kind of version control, like Git, and some hosting service.

Compile Source on Network Drive onto Local Drive

I want to avoid using a service such as Dropbox to store code, even though it is convenient. I'd prefer to store my source on a shared network drive for security reasons, and then access it from two different places.
However, when I do this using an IDE such as Netbeans, the network latency is pretty bad, even when I am on-site, not at home.
Is there a way to store source code on a network drive, but have the compiled objects (classes and war files) written to a local drive? That way I could deploy the local war without having to write it back to a project on a network drive
From what you are describing, sounds like you really should be using Source Control of some sort instead of just sharing over the network. Using source control will really make it simpler when you have multiple boxes editing the same code. Seems like the you already have network access between the boxes, so you would just need to setup your favorite Source Control repository that is supported by NetBeans, such as git or subversion.
Setting up a repo can be a pain, so a web service is always an option. I believe Bitbucket from Atlassian allows free private repositories. There is also Github, but only public repos are free. If you need Subversion, there is Beanstalk, but you have to pay for the service. These are the ones I am familar with, there are a bunch more Source Control services out there.
Under Linux, it is possible to mount a shared network folder anywhere in the filesystem. You can mount it as source folder and have all source files there, and keep all other folders local. Your NAS box most likely supports NFS.
If you do not want to move the current mount point or if the source folder is not at its root, it is also possible to create a symbolic link to it (ln -s target_folder link_folder). It behaves like a pointer.

Packaging up a project for deployment - Java

I have a Java application (a quite large one with many external .jar dependencies as well as dependencies on images) and I need to package it up so that someone can double click to run, for example. Or something easy like that.
It uses Java Persistence, so it requires a sql connection which is specified in the Persistence.xml file in the Java Project.
How can I package this up? I was thinking:
the installation process should validate that the user has MySQL installed and if not, direct them to install it
the installation process could ask the user to enter credentials for any database and then I could update the Persistence.xml at run time
These were two ideas I had...but I wasn't sure if there was a known solution to this problem. Any help would be much appreciated!
I think you should take a look at embedded database solutions, like H2. Also, you can package your application using maven's shadowing or jar plugin, having the jar-with-dependencies profile activated.
This will nicely rid you of checking for database servers running on the client machine, and also will give you the proper means of bundling the application in one nice JAR, albeit a little large.
Maven is a build ecosystem and toolset especially designed for building Java applications and executing the code -- and generally doing whatever else you can imagine that's possible to do with and to your code.
It has a rich API for developing plugins and many developers have exploited this feature. There are numerous plugins for building -- and launching -- and packaging your application as well as helping you manage your applications dependencies.
Maven's shadowing comes in the form of maven-shade-plugin, available here. What it does is that it helps you create a single JAR file from all your dependencies. Also, there is the maven-jar-plugin which offers a profile jar-with-dependencies. It is also accessible from here.
H2, on the other hand is a full-fledged RDBMS. This is the website: http://www.h2database.com/html/main.html, and here is a tutorial.
You can find information on embedding the database here:
How to embed H2 database into jar file delivered to the client?
Embedding the Java h2 database programmatically
h2 (embedded mode ) database files problem
I would also suggest you use a combination of H2/Hibernate/Spring which is a very easy setup and provides you with really rich features and an easy-to-use API.
I hope this helps you :)
Building a sophisticated installer that checks lots of dependencies, and runs on lots of different platforms (which I assume you want) is complicated.
I suggest that you look at an installer generator; see What is the best installation tool for java?
Another alternative that I've seen in a few products is to write a (non-GUI) installer or configurer in a scripting language like Perl.
I wrote an installer using ANT, but has no GUI. Also, I used Iz Pack (good option), so I think that depends on how smart do you want it to be, if you are supposed to use it, or a non-technical person, etc.

Same NetBeans Project from Two Locations

I have a desktop at work, and a laptop at home. I do not carry my laptop to work. Is there an accepted way to use the same NetBeans Java project from both machines?
I currently store the project in a Dropbox folder and access it from both machines. It works 95% of the time, but I occasionally have little glitches (library references, filename case-sensitivity, etc).
I have used a shared network drive, but the latency when compiling and deploying from home isn't acceptable.
I guess I could commit it to SVN everyday, but I probably won't always remember.
Looking to know how others might approach this.
Source control is the best option here, You could use some free SVN/GIT service provider too for your private project
See
https://stackoverflow.com/questions/59791/free-online-private-svn-repositories
Create a bare git repository in your dropbox folder and push/pull from that at home and work. It works very well, and its not that hard to remember. The nice thing about git is that you only need shared disk, which dropbox takes care for you. You don't need a server.
I'm part of a project java and we use a netbeans plugin named Team Server. This plugin allow you to create a project in java.net and work it under Kenai infrastructure. It is really easy to use.

How to use Subclipse in Eclipse Helios (Android)

I am a Android Developer and I want to establish the Subverson
Now I have configure my eclipse with the plugin Subclipse properly and SVN is also properly configured by checking in perspective .Now I am not getting any idea how to use it ,how to create svn server, the local repository to svn and how can I share a project in LAN so my team can work on same project.I have surf lot on net but I am not getting any proper way ....
Subversion requires that there be a central repository/server on which to store all your data. So, you should decide whether you want to host this in-house, or whether you wish to outsource the repository hosting:
In-house Repository
An SVN server does not require a lot of resources, thus does not require the fastest hardware available, just make sure you have a reasonable amount of disk space available - depending on the types of items you are storing (multimedia files, Jars, images, etc).
Without going into the details on installing and configuring the server, just head to Apache to download a suitable binary, and follow their installation instructions. While you can get away with creating just a single user in the server, I would recommend creating one for each team member as this makes it easier to see who last checked-in a file.
Outsourced Repository
There are several organisations that are able to host your project(s), and the choices are determined by whether your project is open or closed source.
Open source projects have several FREE options, such as Google Code or the old favourite SourceForge.
For Commercial closed-source projects, if you have the budget you could opt for a paid service, such as JIRA Studio from Atlassian, who offer SVN hosting, plus their suite of tools - however this is not free. There are probably many other such commercial offerings, however I've not used them personally, so cannot comment on them.
Using Subversion
With most of the setup information out of the way, you'll need to know how to use subversion itself.
Basically, once you have linked your project to SVN, your day-to-day use of SVN will probably consist of the following steps:
Edit Source code
Update from HEAD (to incorporate other changes)
Resolve any conflicts that occurred from other users updating the same line of source code as yourself
Commit your changes to the repository
Repeat
When it comes to releasing your software product, it is common to use the Tagging functionality of SVN, which tags the current revision of each item in your repo with a given name (such as "MyProduct-1.0.0"), allowing you to continue development on the HEAD branch, but still recreate this version at any point in the future.
You will probably find this ebook to be of particular help when it comes to using SVN.
HTH
Subversion uses a client-server model unlike tools like Git that consist of clients. It appears that you are trying to use subversion without a server. I would recommend installing subversion and then following a tutorial such as this one to set up a repository for your team to use.

Categories

Resources