Page 2 of 6 FirstFirst 1234 ... LastLast
Results 11 to 20 of 56

Thread: Why aren't more Linux applications written in Java?

  1. #11
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: Why aren't more Linux applications written in Java?

    Java is actually quite limited in what you can do with it. Think of memory resources: you just shouldn't write a service running on Java if you can get the same thing written in Python with a much smaller memory/CPU footprint. Java is good for standalone programs, defining "standalone" as "stuff that doesn't require interoperation with other stuff", like apps in Android (which is Linux, by the way). But, as soon as you require/want to implement your functionality in some way that may be shared by other applications (in the true UNIX-way), Java is not what you want. If you take a look at most programs you have installed in your system, you'll realize that most of them are designed for interoperability, such that the real functionality is implemented in a C or C++ shared library, which you can link to from many languages (or write a binding, if needed). Hell, you can even call Python code from C and C++!

  2. #12
    Join Date
    Jun 2011
    Location
    Paris
    Beans
    55

    Re: Why aren't more Linux applications written in Java?

    Quote Originally Posted by trent.josephsen View Post
    C'mon, we all know the real reason nobody uses Swing -- it's hideous.

    Other languages have (as it seems to me) better support for other windowing toolkits, which is big. Huge, really. There's no reason to limit yourself to Swing when using Java, but if you're not bound to Swing, you're not bound to Java either.
    Java has other java based toolkits available to it, such as SWT, Pivot, and JavaFX2

    Quote Originally Posted by nvteighen View Post
    Java is actually quite limited in what you can do with it. Think of memory resources: you just shouldn't write a service running on Java if you can get the same thing written in Python with a much smaller memory/CPU footprint. Java is good for standalone programs, defining "standalone" as "stuff that doesn't require interoperation with other stuff", like apps in Android (which is Linux, by the way). But, as soon as you require/want to implement your functionality in some way that may be shared by other applications (in the true UNIX-way), Java is not what you want. If you take a look at most programs you have installed in your system, you'll realize that most of them are designed for interoperability, such that the real functionality is implemented in a C or C++ shared library, which you can link to from many languages (or write a binding, if needed). Hell, you can even call Python code from C and C++!
    http://benchmarksgame.alioth.debian....hon3&data=u64q

    Just to clarify this, Python uses less memory than java in general when both are hardly doing any allocations. Java takes about 17000KB just to load the VM into memory, so when you get into ultra small applications, python's lighterweight vm will always pull out ahead on memory usage (jigsaw should change this though). On the other side of things, java tends to win on memory use as more is needed. As for your cpu footprint, I've never seen any evidence that python is less cpu intensive than java. I've seen plenty of evidence that it is many times more intensive than java though.

    As for interoperability, I'm not sure what you mean. Java can interoperate with other programs like shell programs do (piping input in/out), and it's dead easy to write network binding code for java. You can also call Java code from C or C++ and embed a jvm in your c or c++ code. Python and other languages that need to access jvm libraries can use the same methods c uses to access them.
    Last edited by Leuchten; May 24th, 2013 at 03:44 PM.

  3. #13
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    1,791
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: Why aren't more Linux applications written in Java?

    Quote Originally Posted by trent.josephsen View Post
    C'mon, we all know the real reason nobody uses Swing -- it's hideous.
    Yes, but it can be made to look much better with little effort...

  4. #14
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    1,791
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: Why aren't more Linux applications written in Java?

    Quote Originally Posted by nvteighen View Post
    Java is actually quite limited in what you can do with it. Think of memory resources: you just shouldn't write a service running on Java if you can get the same thing written in Python with a much smaller memory/CPU footprint. Java is good for standalone programs, defining "standalone" as "stuff that doesn't require interoperation with other stuff", like apps in Android (which is Linux, by the way). But, as soon as you require/want to implement your functionality in some way that may be shared by other applications (in the true UNIX-way), Java is not what you want. If you take a look at most programs you have installed in your system, you'll realize that most of them are designed for interoperability, such that the real functionality is implemented in a C or C++ shared library, which you can link to from many languages (or write a binding, if needed). Hell, you can even call Python code from C and C++!
    Java can be interfaced both ways with C/C++ bindings

  5. #15
    Join Date
    Apr 2007
    Location
    (X,Y,Z) = (0,0,0)
    Beans
    3,715

    Re: Why aren't more Linux applications written in Java?

    OK, I stand corrected

  6. #16
    Join Date
    Aug 2011
    Location
    47°9′S 126°43W
    Beans
    1,791
    Distro
    Kubuntu 12.10 Quantal Quetzal

    Re: Why aren't more Linux applications written in Java?

    Quote Originally Posted by WinterMadness View Post
    Just curious, being that its cross platform, wouldn't that solve a lot of compatibility issues? Moreover, if more programs were written in Java (including those on Windows and Mac) wouldn't it help Linux users as well? why don't more people use Java so they don't have to port things as much?

    I know some people dont like Java for various reasons, many of which I agree and disagree with, but the JVM can be helpful. I dont think it slows things down enough to consider speed an issue.

    Please answer every question I present if you are able to. Thanks!
    1) because an app written in Java usually ceases to be a "Linux" or "Windows" application, but becomes a "Java application" that runs on both (plus OSX)...

    2) because your sample of applications is small. There are plenty of applications out there that you'll never see because they are in-house apps.

    3) because the current trend is to deliver all multi-platform apps through a browser instead of having a "thick client", so you don't see the Java, which remains on the server side(*).

    4) because people that sell commercial apps may not want to be burdened with the licensing of the Java runtime.

    5) because people that sell commercial apps think their code isn't protected well enough (Java is easy to decompile and there is only so much you can do with obfuscators)

    6) because with a little care and the adequate graphics library, you can write applications (even very graphics-intensive ones) for several platforms (even if these usually don't include Linux)(see Photoshop... and Gimp).


    (*) In your daily browsing, you likely interact with a dozen of Java-based servers... A vast majority of them run on Linux... using a Java code was developed/tested on Windows workstations....

  7. #17
    Join Date
    May 2013
    Beans
    3

    Re: Why aren't more Linux applications written in Java?

    Java's biggest weakness is that it is hard to build GUI/Desktop applications to the standard that other Desktop apps have. That said, for non-GUI applications it is extremely portable. I develop on Windows and run on Linux, and have never run into any compatibility issues. Compile once run every where, really. We run extremely low latency application (in 50-100 microsecond range), without a problem in Java, so speed is not an issue.

    It's the GUI... always the GUI.

  8. #18
    Join Date
    Jun 2011
    Location
    Paris
    Beans
    55

    Re: Why aren't more Linux applications written in Java?

    Sounding a bit like a broken record here, but have you tried the new javafx? It's pretty much intended to replace swing, doesn't focus on Native look&feel anymore, and is much easier to write UIs in than swing ever was. Here is the feature list:


    • Java APIs. JavaFX is a Java library that consists of classes and interfaces that are written in native Java code. The APIs are designed to be a friendly alternative to Java Virtual Machine (Java VM) languages, such as JRuby and Scala.
    • FXML and Scene Builder. FXML is an XML-based declarative markup language for constructing a JavaFX application user interface. A designer can code in FXML or use JavaFX Scene Builder to interactively design the graphical user interface (GUI). Scene Builder generates FXML markup that can be ported to an IDE where a developer can add the business logic.
    • WebView. A web component that uses WebKitHTML technology to make it possible to embed web pages within a JavaFX application. JavaScript running in WebView can call Java APIs, and Java APIs can call JavaScript running in WebView.
    • Swing interoperability. Existing Swing applications can be updated with new JavaFX features, such as rich graphics media playback and embedded Web content.
    • Built-in UI controls and CSS. JavaFX provides all the major UI controls required to develop a full-featured application. Components can be skinned with standard Web technologies such as CSS
    • Canvas API. The Canvas API enables drawing directly within an area of the JavaFX scene that consists of one graphical element (node).
    • Multitouch Support. JavaFX provides support for multitouch operations, based on the capabilities of the underlying platform.
    • Hardware-accelerated graphics pipeline. JavaFX graphics are based on the graphics rendering pipeline (Prism). JavaFX offers smooth graphics that render quickly through Prism when it is used with a supported graphics card or graphics processing unit (GPU). If a system does not feature one of the recommended GPUs supported by JavaFX, then Prism defaults to the Java 2D software stack.
    • High-performance media engine. The media pipeline supports the playback of web multimedia content. It provides a stable, low-latency media framework that is based on the GStreamer multimedia framework.
    • Self-contained application deployment model. Self-contained application packages have all of the application resources and a private copy of the Java and JavaFX runtimes. They are distributed as native installable packages and provide the same installation and launch experience as native applications for that operating system. See the Deploying JavaFX Applications document.



  9. #19
    Join Date
    Mar 2010
    Location
    London
    Beans
    924

    Re: Why aren't more Linux applications written in Java?

    Another reason, is that many people (including this forum) lead other people to believe that you shouldn't use java.

    When new comers arrive in the land of Linux through the typical channels (such as trying out Ubuntu), they come to forums and are bombarded with how they should use python. Python is king. Python rules all. To use java, you have to install the jdk... yuck. Python comes already installed, it must be better.

    This gets passed down. The next flock of people join the Linux world, and are given the same information.

    Now I personally love Python, but I've nothing against java and I use it on a day to day basis.

    Sometimes I can't help but wonder if many of these people have actually ever had exposure to large enterprise scale systems that are used in the real world. Java is everywhere... there are hundreds of thousands of Linux boxes all running Java processes and serverside code.


    This is just my opinion, of course, but I'm bored of the java hate.

  10. #20

    Re: Why aren't more Linux applications written in Java?

    Perhaps you haven't noticed that most people don't come to this forum looking for the best way for an experienced programmer to build large enterprise scale applications.

Page 2 of 6 FirstFirst 1234 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •