Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm staring a new project using Spring3-MVC w/ Hibernate and MySql and am envisioning the following development setup:
Maven
Eclipse IDE (Having used netbeans in the past, I want to give Eclipse a run)
Tomcat
Questions:
What will be the life-cycle of development?
I've developed struts2 applications with the GF application server and Netbeans IDE in the past. The setup and lifecycle of making a change has been quite slow. Making change to java code, netbeans building code, deploying to GF. I understand these are common points of working with java and webapplication unless I go the Grails way. However, now since there are a few container-less solutions for java web apps - does it make the process a bit fast/east?
Should I use the embedded Tomcat plugin?
In netbeans there is a way to add servers and start a maven project by associating the project with the server. Is there something similar in Eclipse?
Which version of Eclipse should I be downloading?
There seem to be so many I downloaded the javaEE version but it didn't have a way to start a maven project.
You can use embedded tomcat plugin, if you are going with Maven, go with maven tomcat plugin. And deploy your application with:
mvn tomcat:run
In netbeans there is a way to add servers and start a maven project by
associating the project with the server. Is there something similar in
Eclipse?
Yes you can add tomcat server in eclipse, and start/stop tomcat within eclipse, it also allows you to debug easily, by just adding the source projects.
Which version of Eclipse should I be downloading?
Latest :) Eclipse Juno 4.1 I believe.
For starting on maven project, check the maven getting-started guide
Also, you can use maven plugin for eclipse m2eclipse
If starting from scratch I'd recommend using spring boot.
Regarding eclipse, you should get the version 'for java developers' but not the EE version unless you plan on using glassfish or JBoss or some other EE container. Even if you did need the EE version I'd download and use it separately.
It has been a decade since Microsoft ASP.NET has conquered the entire web application development community.A latest alternative have been developed which is known as ASP .Net MVC development. Model View Controller (MVC) is the new thing in the present era that has caught the fancy of many web development companies.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 months ago.
Improve this question
Conventionally, a Servlet Maven project is deployed to Tomcat production server by deploying a generated war to the - webapps - directory of Tomcat. However, Spring-Boot, as a practical trend, recommends jar over war. This preference has no problem for testing, but in case of deployment to an existing Tomcat server in Production, AFAIK, only a war is accepted. So my solution would be:
Generate a corresponding war by modifying the Maven's pom.xml, i.e. set the value of packaging element as war as such: <packaging>war</packaging>. But this is manifestly an extra step
Deploy the project in Production as a running Java program with the embedded Tomcat, meaning there is no normal Tomcat Server at all in production. But is the embedded Tomcat as stable in production as the normal Tomcat server?
In case of deploying a Spring MVC project (no Spring Boot!) to an existing Tomcat server, I tried to use Tomcat Maven plugin in the testing phase instead of using Eclipse with Tomcat server configuration as the Tomcat server should be installed locally as a prerequisite.
Question: Are the solutions above OK? or are there any other better solutions of deployment to production? In case of the third solution, there is only Tomcat7 Maven plugin according to my knowledge, what if I only want to test with Tomcat 8 or Tomcat 9? I tried to use a main class to start up an embedded Tomcat, but it is superb difficult to deal with the dependencies.
I think yes for cloud environment that manages replicas for you as docker containers.
If you deploy as WAR then for the sake of HA you should run multiple aplication server nodes and thus embedded tomcat is not needed.
At the end, it matters the most on how your environment looks right now. With embedded server you loose some features of separate server instances but if you plan to use something like AWS for automatic tasks then it should suffice.
Overall, I think embedded should be ok. You are right that there is a term
make JAR, not WAR
but only drawback of WAR is that using spring boot you cannot use reactive programming I think. Packaging does not matter in your case. It matters in cloud environment because you ensure HA using replicas and for the best as docker containers.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm learning Java and I've been reading these books:
Head First Java, Head First Servlets and JSP to get started.
Up until now, I've been doing most of the learning on HF Java on Eclipse IDE for Java developers(not the EE one). I also installed Java SE 7.
But now I want to move on to HF Servlets and JSP. The book says I need only Tomcat.
I also wanted to familiarize myself with NetBeans, so I downloaded Netbeans IDE for Java EE from this page https://netbeans.org/downloads/index.html.
My questions are : 1. Should I download Java EE before installing this version of Netbeans? Does this version include the Java EE or should I download it from Sun page?
2. Is it overkill to install Netbeans for EE when all I need is Tomcat?
I will eventually learn EE I think... After these two books, I may read HF Design Patterns or HF OOAnalysis & Design Not sure if they're really necessary.
3. What would be the appropriate learning order do you think is ?
Your answers will be appreciated.
1.
Java EE is basically just Java SE with a few additional JARs for EE APIs like Servlets, JAX-WS etc. Installing multiple JREs on a computer will most likely lead to runtime issues because of the question which JRE is the default one, especially on Windows, since JAVA_HOME environment variable is not consulted in Windows Explorer, and tools like Ant and Maven depend on it.
For example, I keep several JREs/JDKs in one folder (unpacked, not installed) and list them in Eclipse to run applications I am developing on a particular JRE.
2.
When you, in Eclipse, do the following:
Window > Preferences > Server > Runtime Environments > Add...
and select Apache Tomcat 7, in the next step you can click on Download and Install... for Eclipse to download the latest Tomcat and set it up in selected folder as a target runtime that will run in the selected JRE.
You can also manually do the same and just point Eclipse to the folder where you installed / unpacked Tomcat.
When you then create the new Server for that Tomcat runtime you can assign a Dynamic Web Application project to it and it will be deployed on every change to the project. You can run it or debug it from inside Eclipse.
3.
Once you are on good terms with servlets and JSPs you should probably continue with the OO Analysis and Design, and then learn the Design Patterns. After those I recommend books on OSGi and Java Application Architecture.
Good luck.
If you install Netbeans EE, it will also install other goodies such as Tomcat or Glassfish. This will allow you to debug your EE application directly from the IDE, as opposed to having everything dumped into Tomcat logs.
I think that since you are just beginning, doing everything from your IDE will allow you to better focus on what you need to learn.
If you learn the usual coding standards and recommended ways in Java SE, you shouldn't have any trouble in moving on to EE. If you read more about OOP and other design patterns, you will be better equipped to build decent applications and also better understand frameworks which are already available.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I installed eclipse 3.8 on my Ubuntu and I want to add Spring to it. I guess I will have to installed the associated libraries to my build path, but where do I get them from?
Do I need to download something? Googling did not really help much.
Also, I have a related question. The framework is basically something that gives you libraries to work with, right? We can make use of those libraries and integrate them in our project.?
Thank.
You have two possible options to add Spring functionality to Eclipse:
Install Spring Tools Suite
The Spring Tool Suite is an Eclipse-based development environment that is customized for developing Spring applications. It provides a ready-to-use environment to implement, debug, run, and deploy your Spring applications, including integrations for Pivotal tc Server, Pivotal Cloud Foundry, Git, Maven, AspectJ, and comes on top of the latest Eclipse releases.
Install STS plugin for Eclipse
Well, if you are comfortable with Eclipse as a DE , you can install STS plugin for Eclipse that will essentially let you create and deploy Spring applications
Coming to your second question, Yes. These are basically libraries that are added to your project and you can use them. You can add these functionalities to your project in two ways:
Use Spring-provided JARS
This is a common method to basically, add and third party API to a Java Project. Download the jars related to spring. Include them in your classpath and use them like you would with ant Third party API. You can use the link Spring Projects to download the required spring library. Unzip it and copy to your classpath.
Use Apache Maven
This will let you manage your spring dependencies and is a hassle free solution to include the necessary jars to needed to build your project.
If you are totally new to spring check out:
Setup Spring from scratch
You can install STS, which by default comes with spring capabilities. Below is dowlnload url
http://spring.io/tools/sts
Install maven(m2e Eclipse plugin or through apt-get). Enable maven in your project, add spring dependencies in your pom.xml.
When you need a given set of jar files in your Eclipse project, the simplest way to do this is to copy-paste them into your Eclipse project, and then for each jar file right-click and choose Build Path -> Add.
This allows you to develop your program.
Then when you need to share the result with others, use Export -> Runnable Jar.
when you get more experienced you may want to use a tool that helps with downloading the jars you need and add them to your build path, and much more. Maven is nice for that, is used by many, but requires quite a bit of discipline.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I've been developing Java with Netbeans and have been using the "Run" command on my project to initialize my testing. I'm using Windows 7. Is it possible for me to run a Java server isolated from Netbeans and use it for my testing so I can learn the basics of a Java server not tied to Netbeans? If so, what should I google?
The simplest server to start with is Jetty , as it's 100% java and embedded easily with no platform specific dependencies. To install jetty, you need only unzip the download.
Once you run a simple jetty tutorial, use netbeans to create a war file - and you can then easily deploy your web application in jetty by just dragging the war to the appropriate folder in jettys home directory.
Now --- To learn about how java web servers work , you can read the terminal logs that jetty produces, which are quite informative** - you can watch as it decompresses and deploys your .war file, etc... And use any old java profilers to monitor its memory/cpu usage.
NetBeans "Run" command works with both local and remote servers. Beyond transfer time, the two are basically indistinguishable, save the NetBeans can not start a remote server -- you have to do that yourself.
As far as working with a server that's "isolated" from NetBeans, there's no reason to even change servers. Simply don't start the server from NetBeans. Start it by hand and use whatever mechanism you like for deployment. Tomcat has a UI you can use, or you can plop the webapp in to the webapps folder and let it auto deploy, Glassfish you can use the UI, or asadmin, or the autodeploy folder.
The only other magic the NetBeans may do, especially for Glassfish, is that it may auto-deploy resources like connection pools and what not. You can easily mimic this by firing up your existing server and simply removing those resources before you deploy, and then learn how to recreate them by hand.
If you're using Glassfish, you don't have to play with your existing domain, you can create a brand new one on your existing server. Give it different ports, if you like, etc. It's straightforward and easy to do. If you have no port conflicts (and the memory), you can bring the two different domains up and down simultaneously.
Deploying a WAR or EAR is pretty easy with most of the containers. It's important you learn the details just do you can move projects to production, but it's really not a big deal -- especially if you don't have a lot of container configuration to do (shared libs, custom security realms, connection pools, etc.)
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I have been a project manager so far in a small company that focuses on PHP and .NET Development. No Java Development.
I learnt Java and J2EE 4 years back. I know things changed radically now. I would like to dive back to Java Enterprise Development. Can you guys tell me what the typical Development Environment is like in the big / small companies for Java / Java EE? Lot of friends who are in Java Development says, they use Spring and Hibernate.
What I would like to know is things like this...
Eclipse or NetBeans IDE or some proprietary IDE? Do we get to choose the one we are comfortable with?
Local or Remote Web and App Servers?
I see that when I create a simple Java Project using eclipse, it adds some eclipse related tags / classes in the config files. Is this acceptable?
And so on...
Hope my question makes sense...
Please shed some light. Thanks in advance!
Eclipse or NetBeans IDE or some proprietary IDE?
IntelliJ from JetBrains is the best Java IDE out there. That's what my team uses.
Do we get to choose the one we are comfortable with?
Depends on where you work. I think it makes sense to allow the workman to choose his/her tools.
Local or Remote Web and App Servers?
We use Spring, so developers use Tomcat to deploy locally. The web servers exposed to the outside world are maintained by others; usually IIS or Apache. The app servers are JBOSS 5.
I see that when I create a simple Java Project using eclipse, it adds some eclipse related tags / classes in the config files. Is this acceptable? And so on...
Your IDE should not add anything that you don't want. I personally don't care for Eclipse.
Eclipse or NetBeans IDE or some proprietary IDE? Do we get to choose
the one we are comfortable with?
It depends. In a company I last worked for, they loved NetBeans while I preferred Eclipse (more configurable than NetBeans IMHO). NetBeans, however, is now owned by Oracle (formerly Sun) and thus comes with integrated Java EE packages to start with Development right away (includes GlassFish and Tomcat bundled). Eclipse Java EE doesn't include a webapp server.
Local or Remote Web and App Servers?
That totally depends on the company.
I see that when I create a simple Java
Project using eclipse, it adds some
eclipse related tags / classes in the
config files. Is this acceptable? And
so on...
These config files doesn't affect your project when exporting it to JARS/WAR/EAR, etc. Those config (.project, .classpath) are basically your project information Eclipse uses. NetBeans does the same. If these do affect your project when exporting, rather use Ant/Maven to build your project.
You'll get as many answers as there are software companies.
I'll speak for mine:
Eclipse
Tomcat for local and remote
I'm not sure what you mean here. Eclipse will definitely need .project and .classpath files if you want to share project, but I am not sure that it adds tags to config files.
Definitely look into maven for builds, using it makes your projects ide-agnostic, and you can have people using eclipse or netbeans or whatever is their favorite and still be able to contribute.
The ones that are used in the Java shops around here are mostly Eclipse, with the latest version of Netbeans gaining popularity. Personally I find Eclipse to be decent and meets my needs, but YMMV