How to start using velocity - java

How do I start using velocity? Is there a place that helps me understand what do I need to install? which server? how to start? first steps?
I know how to install wamp (I have windows) and work a bit with PHP on aptana - so this is my general knowledge and I need to know the first steps to velocity (what type of server do I need? Will Aptana do the trick or do I need to install also eclipse?)
thanks,
Alon

The "Getting Started" section in the Velocity developer guide is the place to get started on the code side.
What type of server do you need? Are you going to use Velocity to create a web application using Velocity? You'll likely want Apache Tomcat (or Jetty, etc.) to get started, because there's a ton of documentation and tutorials.
Aptana is Eclipse, but you might be better off with a plain old Eclipse; Aptana is geared more towards framework-specific functionality (PHP, Rails, etc.) You should be able to add the Java ecosystem web stuff to it if it isn't already there; not sure how easy/difficult it would be.
Be aware that making a jump from PHP to Java web development is a big leap in terms of what you need to know, how apps are generally coded, the Java ecosystem (libraries in particular), etc.

Related

Setting up JSP Server?

OK so at work I've been working with Java to start migrating our legacy database and in-house systems to something more modern. Well today I was asked if there was a way to use HTML/CSS as a front end to the java programs I've made. So my coworker and I have set up Tomcat on our Ubuntu 12.04 server in hopes of using jsp. Now we don't know where to go. I've been using Netbeans for my java development and all the tutorials and articles I've found has been about installing the server on my PC and I think that can't be right. Are there any good, semi-current (as in not from 2003) tutorials or articles for setting this up? Both my coworker and I have experience with PHP and it's not this difficult to set up.
It doesn't matter where you install Tomcat, your computer or a separate server. Create your web application, drop the war into tomcat/webapps and you're ready to go (to http://yourservername.com:8080/nameofwar/). Of course if you've never actually created a web application, there's some additional complications.
If you're familiar with Netbeans, you probably want to create a Dynamic Web Project. Plenty of resources to be found with all this info I've given you.

Apache MINA Vysper documentation?

I plan on making an instant messaging app on Android and iOS, where you can chat to other people with the app, along with some custom features.
I’m going to use the XMPP protocol, and make a custom extension for it. I plan on making a Java application running on Amazon Web Services (AWS) so it's scalable.
After researching server options I’ve decided to use Apache Vysper.
However, I’ve never made a proper Java application before, and have never used XMPP, AWS or Vysper – so I’m rather reliant on good documentation :-)
The Apache Vysper project is very new and so the docs are a bit sparse. I was wondering if I was missing something, should I be using the general MINA docs as well? Are there other resources
elsewhere I don’t know about?
“Apache Vysper can run stand-alone or embedded into another
application.”
To be honest I’m just as lost when it comes to working out what to use to make a Java application anyway. Do you know if the AWS Java SDK has everything I need to make an application to use on AWS? And then is it a simple matter of integrating Vysper into this? Or do I need to make a Java application using something such as the Spring framework?
Thanks for taking the time to help me. If you know anything that could clarify the situation I would really appreciate it :-) --and sorry be being a bit useless, but hey, we've all got to start somewhere right ;)
First of all, as the founder of Vysper I apologize that the documentation is lacking completeness.
To answer your question(s).
Most Java applications bring their own ready-to-go start scripts with them.
Vysper is no exception. You get the pre-packaged download here:
http://mina.apache.org/vysper-project/downloads.html
Ok, before running it, you need to have Java installed, whether you're on your own machine, AWS, a server or a virtual machine anywhere else. Get it from Oracle, or use the package management of your Linux distribution. Make sure that after installing Java, you can execute "java -version" on the command line and you are all set.
Then, unpack the Vysper download, change to the bin/ directory and execute "run.sh" or "run.bat", depending on your OS.
Please note that support for Vysper - besides here on StackOverflow - is available on the MINA user mailing list here:
http://mina.apache.org/vysper-project/mailing_lists.html

How to make a browser based IDE to code in the cloud?

I have read a bit about cloud and browser based IDE's.
I am planning to make a Java based bare bones IDE by integrating a compiler to code in the cloud. This is for educational purpose as I am just determined to learn to develop cloud based IDE.
I want it to be something like eclipse Orion but i want it to allow for coding in java. It should allow users to code, compile and run java programs by directly writing .java files and not by converting the .js files into java files.
Can someone please suggest me an existing cloud that I should use for this. And also, I am just a beginner and I have no clue about how to proceed and the articles that I am required to read.
Please do let me know what I should begin with and the cloud that suits my needs the best.
Thank you very much in advance.
You should look at projects like Mozilla SkyWriter, which implement the bare bones editing functionality
(There have been a lot of change lately. There seems to have been migrated to Ace)
You can use Codenvy and put your code on a Git repository. Then, you could build automatically once you have done the push using a CI tool like Jenkins. Now, I have an environment in which I use a Jenkins instance as a Service and also a runtime environment so I can get a continuous deployment pipeline. This video will show you, in a graphical way, what I am talking about.
Koding provides you with a full Ubuntu machine, with root, so it's able to run and do what you want, programming wise.
The reason i'm suggesting Koding though, is that they have a Framework to develop your IDE for the Koding VMs themselves.
The logic here, is that making IDEs is challenging, but the biggest challenges is ensuring security between your IDE users. Using another VM platform would mean that you don't have to manage the security of your VM, and focus entirely on your IDE.
Let me know what you think :)
For virtual/cloud hosting try one of the following:
Rackspace
VPS Farm
I like vpsfarm because it is cheap and pretty bare bones.
For the IDE itself, I would first create a webapp that can upload and compile and run arbitrary java code, without adding libraries or J2EE. That alone will be a good undertaking for one dev.

Making a Java Application available via a Web Browser

I am working on a Java program that has bunch of classes consisting of dialog boxes, JFrames, etc.
Can someone guide me where I can learn how to transform it to an 'applet' kind of. ( I don't even know if applet is the right word)
Like for example, can it be accessible through the internet browser. If I somehow make a domain www.myjavaprogram2011.com it would be nice if it will take it straight to the java program I coded. I see this as anyone can come to this website and use that program.
Thanks!
You may want to look into Jars for distribution or probably more aptly Java Web Start as this allows Clients to be downloaded and run.
Java Applets isn't your best bet as there's lots of security permissions that you need to worry about as well as your jars needs to be signed (especially for client/server data access).
Try using Java Web Start, it will allow you to launch fully-featured application from the Web Browser. Oracle has tutorials on deployment of JWS, etc.
Sounds you're looking for some kind of RIA technology. Have a look at JavaFX, though it's not mature yet IMHO.
Ah, but then, if you already have a Swing application then this isn't an option probably.

Java in a Microsoft shop

I've been introduced to this wonderful project, xhtmlrenderer; the flying saucer project. Problem is, is that where I work, it's strictly a microsoft shop and I haven't done any java development since college, and a smidge of WebSphere a few years back.
I was wondering what it takes these days to do java development? I set up a quick proof of concept to see if I could do what I wanted with this project and it works great, however, I used jnbridge whose licenses are a bit on the expensive side but Visual Studio was what I had handy and got the job done with an hour of finagling.
I'm wondering what it take to do java development these days? Are servlets still the norm? Is Apache where I should start looking to get a small web server up and running? Is Eclipse/Ganymede the IDE to use?
Essentially what I want to do is pass a url to the service and have it spit back out a PDF. Just on vacation right now, and stuck on dial up, but can't stop thinking about this.
Thought I'd post these thoughts now to see if I can get a jump start on next weeks work.
Eclipse is certainly the IDE on no budget, NetBeans is also free. I prefer IDEA from Intellij, but for something that sounds like such a side part of your project, it probably isn't worth the money.
In terms of servlets, etc., it really depends on the archetecture/scalability you are looking for.
If you are looking for something that needs to run as a small web interface, then something like Jetty or Tomcat with a basic servlet should be fine.
You might be looking at something invoked via the command line, although starting a JVM for every conversion is going to be too heavy for all but the most trivial usages, but a little program that monitors a directory and pulls stuff out of it for the conversion may be what you need.
If you give more details about the archetecture and how you are planing to use it you could get some more specific advice.
In general .NET and Java development are quite similar (.NET was started to compete directly with Java, after all), but the real practical difference is that a lot of the .NET environment is kind of provided to you on a silver platter. You need a web container, you have IIS, you need a database, you have MS-SQL, You need an IDE, you have Visual Studio, etc., etc. In Java development, these are all choices to be made, there isn't really a default obvious good choice for a lot of things - there are many competitors. That can create a larger curve for a Microsoft shop than you are expecting.
Java's not all that different, although generics add some excitement; PDF with iText is fairly straightforward; and the IDE world is pretty much the same as ever. Eclipse and Netbeans are common, there are several others, and real programmers still use EMACS.
Apache is pretty generic, but with servlets in mind you might think about Tomcat.
If you want a small enough web server, you can always use an embedded Jetty. If you need the full services of Tomcat, it's also available. For Java development, I use Eclipse for an IDE. Not only is it free, but its support of refactoring is ahead of Visual Studio. Actually, if you used the WebSphere development environment, then Eclipse will be very familiar.
Consider sneaking in IKVM (http://www.ikvm.net/) as it allows you to use Java components in a .NET environment.

Categories