Is there any advantages to make web site using JAVA?
I think PHP is much bettter to use.

Dani AI

Generated

Short answer: there is no universal "better"—the right choice depends on the site requirements, team and hosting constraints. Several posts here raise useful points: correctly warns that language features only become advantages when they match real needs; touches on portability and runtime behavior; lists language strengths. The guidance below turns those observations into a practical decision checklist and a lightweight workflow.

When Java is a strong choice

  • High and sustained traffic, low-latency services or many concurrent transactions where a long-running JVM and JIT can pay off.
  • Complex business logic, heavy integration (enterprise messaging, multiple data sources) or systems that need strict compile-time checks and strong refactoring tools.
  • A multi-service architecture or microservices environment where JVM tooling, libraries and alternative JVM languages (Kotlin, Scala) are useful.
  • Long-term maintainability and large teams that benefit from strict typing, IDE support and proven testing frameworks.

When PHP is a strong choice

  • Content-driven sites, small CMS projects or prototypes where time-to-market and cheap shared hosting matter.
  • Teams with strong PHP experience or ecosystems (WordPress/Drupal) already providing needed features.
  • Projects where developer velocity and minimal ops are bigger priorities than raw throughput.

Practical workflow and quick tips

  • Start by listing non-functional requirements (expected load, uptime, maintenance horizon, integrations). Build a tiny prototype and run simple load/response tests rather than deciding on intuition alone.
  • If choosing Java: prefer a modern framework (Spring Boot or lightweight microframeworks), use Gradle/Maven, containerize, add APM/profiling, and tune GC/connection pools if latency becomes an issue.
  • If choosing PHP: use a framework (Laravel/Symfony) or a CMS, enable opcache/FPM, and keep an eye on database pooling and session handling.
  • In all cases, measure: profiling and realistic load tests will show which stack meets the actual requirements.

Recommended Answers

All 4 Replies

PHP is very good for small projects. It is not all that scalable, however, and is not suited to large projects. JSP/Servlets are, generally, also faster (when written with comparable quality, whatever that may be).

There is a great advantage with java is it's platform compatibility and reliability.
once a java code has compiled it can be run anywhere, if you require more code security then you can use srvlet for web development.
php can also be use but it is best for small scale projects.

Java is best for developing website. Some advantage are:
1. Java is platform independent.
2. It is robust language.
3. Java is object oriented.
4. It has multitasking facility.

I'm sorry, but those are features. They are only advantages when applicable.

#1 is not applicable if the system being designed is only going to run on a single platform (regardless of which).
#2 is only applicable if it is needed. A simple site with a few pages of only minorly interactive content won't
#3 so are many others, and, I can repeat the #2 statement
#4 a complete repeat of the #3 advice.


Once again, I'm sorry, I don't mean to be harsh, but not all features of a language are necessarily an advantage in all situations. In fact, each of those features is a distinct disadvantage when my counter points are applied.

Discover the requirements, then analyse your choices, don't attempt to use a pat list of "features" as "advantages" and blind yourself to the realities. And, when offereing it as advice than qualify the statements.

commented: Great answer. +10
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.