Compile Source on Network Drive onto Local Drive - java

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.

Related

How to Group Programming cross Internet

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.

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.

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.

Hosting of a Jar file

I have a jar file which contains two Java classes. Using the javamail API I have developed these classes to read and edit my mail, then send to another mail id.
I am able to execute this through my standalone system via Eclipse. Now I want to host this jar file somewhere remotely so that it would fetch the data in real time and execute the job regularly. I have contacted couple of hosting sites and they are saying that they require a war file instead.
Does anyone have any suggestions to this problem?
To give you another point of view and to be constructive, I would go with embedding your jar into a war application and you get some things for free, the most important I think is that you gain a managed application lifecycle so with a standard web application context listener you can start and stop your program in a managed way. Besides you have more hosting options and it is less work.
Good luck with that.
As I don't know of any services specifically for plain execution of executables, your best bet is probably getting a cheap VPS. With some searching you can probably find one that would work for around $5 USD/month. For a single simple app you'd only need around 128MB of memory.
Pick one up, install Java (whatever Linux distro you get probably has OpenJDK in the repositories), copy your files over, and set up a cron job to run the executable at a set interval.
For easier administration, install something like webmin and use that to configure the cron job. The command would likely just be java -jar /path/to/my/App.jar, and you can use the web interface to configure the intervals for the command to be executed.
For an app like this, I would avoid anything related to a war file. You aren't making an application with a web interface (like a PHP app or some such) so it really wouldn't be appropriate. You would have to write some extra code to make it compatible with a container like Tomcat, and on top of that the memory requirements for running the application server would be a lot higher.

Library or jar that displays the remote system process list in Java

I am searching a library or jar file for making a system monitoring program. I found that Java provides jConsole, but I need some other jar file name.
actually i am making a web service in which i have ip address and port no of remote computer and based on that i need a system process list of that computer, and that web service i will call from the google apps engine that will display the whole process list. so i need name of jar file that can i place on server and that give me the process list.
I've built such a system before and JMX (java management extensions) was very useful.
http://www.oracle.com/technetwork/java/javase/tech/javamanagement-140525.html
examples and tutorials:
http://docs.oracle.com/javase/6/docs/technotes/guides/jmx/
You can install small agents on the machines you wish to monitor. These will gather information and either push it to a main monitoring server or the monitoring server will pull data whenever it wants from those monitored clients.
You will also need to have a database to store which attributes on which machines nodes you are monitoring. You can serialize the attributes with xstream, which creates an xml out of java objects and vice versa. You can store these in the database.
The attributes can be monitored by creating beans on the monitored machines.
You might also want to give Nagios a try - a commercial solution.
There is no jar file that you can get for free and just add it to your project (at least none that I know of right now).
It's a bit hard to understand what you are looking for, given that you din't provide much information. It sounds like you might be interested in JMX.

Categories

Resources