Slashdot Mirror


Modularity Finally Approved For Java 9 (infoworld.com)

An anonymous reader quotes InfoWorld:With a new round of voting completed this week, the Java Community Process Executive Committee passed by a 24-0 vote the Java Platform Module System public review ballot, the subject of Java Specification Request 376. In May, the same group, citing concerns over the plan being disruptive and lacking consensus, voted the measure down, 13 to 10... Red Hat, which voted no on the previous ballot but abstained from the latest one, said there were still several items in the current proposal that it wanted further work on. "However, we do not want to delay the Java 9 release," Red Hat said. Getting "real world" feedback on the modularity system will be key to determine where further changes need to occur, Red Hat said. The Eclipse Foundation, Hazelcast, and Twitter, all of which voted no previously and yes this time around, cited sufficient progress with modularity.
Java 9 is still slated for release on September 21st.

50 of 94 comments (clear)

  1. Re:Narly by FatdogHaiku · · Score: 1

    gnarly dude...

    --
    You have the right to remain sentient. If you give up the right to remain sentient, you will be elected to public office
  2. Design be committee by 110010001000 · · Score: 3, Insightful

    Definitely proves that Java is "design by committee" considering there were 24 votes. No wonder it is such a disaster.

    1. Re:Design be committee by Anonymous Coward · · Score: 1

      And Twitter is on that committee. WHAT???

    2. Re:Design be committee by angel'o'sphere · · Score: 4, Insightful

      The most successful and most widely used (programming) language on the planet is a disaster?
      In what world do you live?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:Design be committee by Anonymous Coward · · Score: 1

      What does C have to do with anything?

    4. Re:Design be committee by gweihir · · Score: 1

      Indeed. Most Java "coders" live in a filter-bubble and have not realized that it does not get much lower in skill than they are.

      --
      Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
    5. Re:Design be committee by allcoolnameswheretak · · Score: 1

      The most successful and most widely used (programming) language on the planet is a disaster?
      In what world do you live?

      Java is the most widely supported and used language in the world, you can even get a well-paying job with it *gasp*, so it's too mainstream for the cool kids.

      If you want to keep up appearances of being an 1337 haxxor and gain Slashdot cred you need to show contempt for Java and either support some new, cutting edge shit or some incredibly old, outdated shit nobody uses anymore, like Fortran.

    6. Re:Design be committee by angel'o'sphere · · Score: 1

      It would be more helpful if people that hate Java would simply make a list of points they hate.
      Then we could fix the points or educate the people.

      On the other hand someone could stand up and simply write a GCC backend (or LLVM) that compiles to the JVM, then I could code in C++ again and had all benefits of the JVM and the huge library/framework eco system around it.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  3. What is modularity, exactly? by ZackSchil · · Score: 5, Informative

    I am a professional programmer but I don't work with java, so I was confused about what, exactly, "modularity" means in this context. I clicked through a few links and found the info and figured I'd share here for anyone else in my position.

    Java, as it stands, has no real mechanism for managing program dependencies (think, dynamic link libraries). Either a JAR file embeds all of the classes it uses or it loads external classes using something called the "class path system", where there is a programmatically accessible path where java code can look for class files to link in at runtime. This system is very simple, and lacks built-in versioning or encapsulation features. It's up to developers to build in their own versioning into the file structure. As you could guess, it's generally very brittle.

    The new system replaces that with a concept of "modules". These are collections of classes with strong names, cryptographic signatures, version numbers, and members that are either public and advertised to code the imports the module, or private and for internal module use only. This is a huge step up from the idea of just going and loading class files out of some path. I'm actually astonished Java made it this far without such a feature!

    You can find more info about the new module system here: http://openjdk.java.net/projec...

    1. Re:What is modularity, exactly? by K.+S.+Kyosuke · · Score: 1, Informative

      so I was confused about what, exactly, "modularity" means in this context

      The same thing it meant for the last forty years since Modula?

      --
      Ezekiel 23:20
    2. Re:What is modularity, exactly? by angel'o'sphere · · Score: 4, Informative

      I'm actually astonished Java made it this far without such a feature!
      There is no language / system on the planet that has such a feature. Except Java 9.

      class path system
      Which works exactly like the LD_LIBRARY_PATH for any compiled language on Unix or the equivalent on Windows.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    3. Re:What is modularity, exactly? by angel'o'sphere · · Score: 4, Insightful

      Unfortunately not.
      The parent is completely correct that using the term "module" or "modularity" in Java 9 is completely misleading.
      It has absolutely nothing to do with any meaning of "module" in any other programming language.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    4. Re:What is modularity, exactly? by Anonymous Coward · · Score: 1

      I am a professional programmer but I don't work with java, so I was confused about what, exactly, "modularity" means in this context. I clicked through a few links and found the info and figured I'd share here for anyone else in my position.

      Java, as it stands, has no real mechanism for managing program dependencies (think, dynamic link libraries). Either a JAR file embeds all of the classes it uses or it loads external classes using something called the "class path system", where there is a programmatically accessible path where java code can look for class files to link in at runtime. This system is very simple, and lacks built-in versioning or encapsulation features. It's up to developers to build in their own versioning into the file structure. As you could guess, it's generally very brittle.

      The new system replaces that with a concept of "modules". These are collections of classes with strong names, cryptographic signatures, version numbers, and members that are either public and advertised to code the imports the module, or private and for internal module use only. This is a huge step up from the idea of just going and loading class files out of some path. I'm actually astonished Java made it this far without such a feature!

      You can find more info about the new module system here: http://openjdk.java.net/projec...

      Java has had modularity for over a decade, but it just wasn't part of the language itself. It was called OSGi. Jigsaw is effectively a cut down version of OSGi.

    5. Re:What is modularity, exactly? by Lisandro · · Score: 1

      Thanks. Frankly it is astonishing that it took Java 22 years to get dependency handling right.

    6. Re:What is modularity, exactly? by pjt33 · · Score: 1

      The new system replaces that with a concept of "modules". These are collections of classes with strong names, cryptographic signatures, version numbers, and members that are either public and advertised to code the imports the module, or private and for internal module use only. This is a huge step up from the idea of just going and loading class files out of some path.

      According to the document you linked, the module system explicitly doesn't include versioning information, and it says "This is intentional: It is not a goal of the module system to solve the version-selection problem".

      I'm actually astonished Java made it this far without such a feature!

      Why? How many languages do have such a feature? The only thing I can think of which does is the .Net ecosystem.

    7. Re:What is modularity, exactly? by K.+S.+Kyosuke · · Score: 1

      There is no language / system on the planet that has such a feature. Except Java 9.

      I'm pretty sure that whatever modularity feature you can come up, Scheme most likely already has it.

      --
      Ezekiel 23:20
    8. Re:What is modularity, exactly? by K.+S.+Kyosuke · · Score: 1

      And what exactly are the unique points (besides those that involve Java specifics such as jar or class files)?

      --
      Ezekiel 23:20
    9. Re:What is modularity, exactly? by abies · · Score: 1

      Thanks. Frankly it is astonishing that it took Java 22 years to get dependency handling right.

      That's quite loaded statement.

      1) Java has very good dependency mechanism for long time (since 2004 or so), bit similar to what you get with rpm/deb/etc, just on more fine-grained library level. Unlike rpm/deb/etc, it is single standard everybody follows. It is called maven (which is also a convoluted build system, but almost all other build systems have hooks into maven-standard dependency mechanism). It solves version mismatch issue by either using latest version for given dependency among declared options or you can override it by hand in your build.

      2) Going further, there is an OSGI framework which allows you to solve version dependency conflicts during runtime - so you can have multiple versions of same library used by same program at same time. Unfortunately (or not), it is a lot less common than Maven and it is terribly overcomplicated for simple things. Still, solution was there for many years even for that quite complex problem.

      Java 9 modules are not really solving any problems which were not solved before. From what I understand, their 'novelty' is in:

      - it will be bundled in standard distribution (as opposed to external tools)
      - module information will be available _also_ during runtime through reflection (rather than compile/build/deploy/start time as with other tools), which can allow some extra tricks like on-demand loading (which is probably 20 years too late for save applets, but they had open ticket for that probably ;) and easier implementation of OSGI-like containers in app servers
      - more explicit export features from modules (present in OSGI, but not in maven)

      So java had no issues with lack of dependency handling. I, personally, do not look forward towards java 9 module system. Between maven (for 99.99% of cases) and OSGI (for that 0.01% of apps which need dynamic loading of unknown versions of conflicting libraries) I found java dependency mechanism good enough. With java 9 modules, I'm afraid we will see a lot of compatibility issues (not everybody can update to java 9 immediately in same company), possibly requiring people to provide pre-9 and post-9 version of libraries plus extra effort, as maven metadata will still have to be maintained.

    10. Re:What is modularity, exactly? by angel'o'sphere · · Score: 1

      This is a site that lists 'modules'. (based on the definition what a module is, as defined by the scheme standards)
      Not a site about a module system as in Java 9. It is misnamed in Java 9 and should be called packet manager.

      To answer your other post:
      In Java everything is loaded dynamically and linked dynamically. To find libraries/*.jar files a "PATH" variable is used.
      The first match is taken.

      In the new module system, a library/starting executable can define dependencies, which most notable includes the version of the library it depends on. This is transitive resolved. I guess it involves repositories like with maven (a java build tool)
      That means: if everything is correctly configured, e.g. remote repositories, you start a single jar file and all dependencies it has to other libraries (note again: that includes/implies the version number) get resolved during start up, the libraries get either put onto the internal "PATH" variable or downloaded from a repository. The dependencies are written inside of the jar file, and not outside in a configuration that configures the "CLASSPATH".
      In the end you have all libraries/dependencies with the correct version number on the "PATH".

      It has absolutely nothing to do with how modules work e.g. in Modula 2.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    11. Re:What is modularity, exactly? by complete+loony · · Score: 1

      There are two things I'd add to your description.

      Firstly this is an attempt to split the core java libraries into pieces so you will be able to use only the pieces you need. eg; $ apt-get install java-headless. Due to the existing definitions of packages and classes, this could not be simply done by splitting the existing classes along package boundaries, a new abstraction was required.

      Second, with Java's existing access controls of public, private, protected and default. There are quite a few occasions when the language forces you to make an implementation detail of your code public, which you would rather leave inaccessible to 3rd parties. Modules essentially demotes "public", and adds a new explicit "really public".

      --
      09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
    12. Re:What is modularity, exactly? by intellitech · · Score: 1

      Which works exactly like the LD_LIBRARY_PATH for any compiled language ...

      Actually, it doesn't. Library loading in runtime versus compile time.

      The "class path system" is only a problem because of runtime.

      If java was a compiled language, this wouldn't have ever been a problem.

      --
      vos nescitis quicquam, nec cogitatis quia expedit nobis ut unus moriatur homo pro populo et non tota gens pereat.
    13. Re:What is modularity, exactly? by angel'o'sphere · · Score: 1

      Java is a compiled language.
      And you are wrong.
      The CLASSPATH works exactly like PATH and LD_LIBRARY_PATH.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    14. Re:What is modularity, exactly? by K.+S.+Kyosuke · · Score: 1

      This is a site that lists 'modules'. (based on the definition what a module is, as defined by the scheme standards)

      There wasn't a Scheme standard for modules until R6RS and many R6RS-avoiding Scheme implementations avoid R6RS-style modules.

      Not a site about a module system as in Java 9. It is misnamed in Java 9 and should be called packet manager.

      Why? There can still be a mapping between language modules and implementation packages. In fact, one would prefer a system where you don't have to care about the latter at all.

      In the new module system, a library/starting executable can define dependencies, which most notable includes the version of the library it depends on.

      Yes, there are Scheme versions of such features, which I mentioned. Racket behaves like this, for example.

      --
      Ezekiel 23:20
    15. Re:What is modularity, exactly? by angel'o'sphere · · Score: 1

      Looks in fact quite similar.

      To bad it is Lisp ^_^

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  4. Re:HAHA by Anonymous Coward · · Score: 1

    In your dreams, maybe

  5. Re:no need for java 9 here by __aaclcg7560 · · Score: 2, Insightful

    Casey Neistat has a video that defined success as people wanting to be like you. I'm not surprise that someone keeps posting as me on Slashdot. It's not like they have anything better to do with their life.

    https://www.youtube.com/watch?v=3iQ8BGw13So

  6. Is this "modularity" going to improve security? by QuietLagoon · · Score: 1

    That's my biggest concern with java.

    1. Re:Is this "modularity" going to improve security? by squiggleslash · · Score: 1

      Yes, everyone should stick to PHP and C until they do something about the security issues in Java.

      --
      You are not alone. This is not normal. None of this is normal.
    2. Re:Is this "modularity" going to improve security? by Lisandro · · Score: 1

      PHP and security should never, ever go in the same sentence.

    3. Re:Is this "modularity" going to improve security? by Hognoxious · · Score: 1

      Yes. It'll slow it down so much that intruders get bored or die before they can do anything.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    4. Re:Is this "modularity" going to improve security? by QuietLagoon · · Score: 1

      ... That's the whole point....

      Well, if "that's the whole point," why don't I see significant mention of it? Or is security, yet again, little more than an add-on afterthought?

  7. Anything But Java by Anonymous Coward · · Score: 1

    We haven't written anything new in Java in several years, and if it weren't for legacy products that need ongoing support, we would abandon it altogether.

    1. Re:Anything But Java by thegarbz · · Score: 1

      So what you're saying is your entire company missed the smartphone revolution?

    2. Re:Anything But Java by melmut · · Score: 1

      You failed a project, so Java must suck, right?

  8. Re:HAHA by johanw · · Score: 1

    Not for Android development (although C++ can be usefull there too for use in libraries). But there Java 7 is the norm, when I use 8 it works but Android Studio keeps complaining about deprecated stuff in existing code. So I'm not even going to install 9, seems like a lot of work with no gain.

  9. ActiveX by Latent+Heat · · Score: 1

    Could they be talking about something like COM and ActiveX? COM and ActiveX modules are nothing more than DLLs, but they are registered into the Registry and have versioning and All That Jazz. There is something called the Global Assembly Cache (GAC -- is this a Klingon delicacy?) in the .NET universe doing the same thing?

    By that reasoning and way of bending the English language to their will, LD_LIBRARY_PATH is not a "modularity system" for loading a DLL whereas finding a COM or ActiveX module through its GUID is such a thing?

    For all the shade thrown on Microsoft and Windows and especially the Registry, there is a certain brittleness to requiring PATH be set to find your DLL module and a certain robustness to doing regsvr32 MyModule.ocx and then being able to load MyModule by supplying its global identifier? Whether or not people believe the COM/ActiveX way is better; I am trying to say it is different from simply having MyModule.dll on the PATH, and I am asking this is the correct interpretation of what Java 9 is trying to do?

    And if COM/ActiveX registration is what Java 9 is trying to do, then there are indeed other systems on the planet with this feature, namely Windows API/Visual C++ / Windows .NET/C#? Not that there is anything wrong with that!

    1. Re:ActiveX by angel'o'sphere · · Score: 1

      No, the things you mention are no such things.

      The GUID and references for COM/ActiveX etc. are hard coded. They don't follow required versions etc.

      You somehow wasted your breath :D

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    2. Re:ActiveX by Latent+Heat · · Score: 1

      You are telling me that "versioning" in ActiveX is not a "thing"?

      https://msdn.microsoft.com/en-...

    3. Re:ActiveX by angel'o'sphere · · Score: 1

      Versioning is certainly a thing.
      But if a required DLL is missing it is not downloaded and linked.
      And if you had read the link you provided you had realized it has nothing to do with the Java Module system and transitive dependency management based on "required libraries and required versions of those".

      Why are you wasting your and my time when you clearly have no clue about what we are actually talking?

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  10. Re:HAHA by gweihir · · Score: 1

    Not yet, but it is dying and will continue to do so for a long, long time. The problem is not even the mediocre language itself and the incredible bloat and complexity most of its uses come with, but that basically anybody competent learns something else. Java is the language of incompetent "coders" and prospective employers are slowly wising up.

    --
    Most ACs are not even worth the keystrokes to insult them. Be generically insulted by this and ignored otherwise.
  11. it's a trap by ooloorie · · Score: 1

    Oracle will sue you.

  12. Re:HAHA by johanw · · Score: 1

    No, it's something about the use of underscores. No idea what's the problem, and since that's not mine code but someone else's I can't change it at will.

  13. Now what about support for unsigned values for da? by Travelsonic · · Score: 2

    Apparently that has been done a bit, but I personally would love to see full support, proper support, for unsigned values in data types if it hasn't been done already.

    --
    If you believe in privacy, and believe you have "nothing to hide" at the same time, you're a goddammed idiot
  14. Chill pill by Latent+Heat · · Score: 1

    How I spend my time is my own personal concern.

    How you spend your time is your free-will choice.

    Whether comments are meritorious is the domain of Moderation.

    Yes, I do not know what "we are actually talking about." That is why I am offering analogies posed as questions. It seems that very few people commenting here "get" what the Java Module System does. How does this make you feel?

    1. Re:Chill pill by angel'o'sphere · · Score: 1

      Lol, no particular feeling.

      Actually wonder how wide spread the module system will be used.
      After all we already have OSGi, and most people bundle all required libraries for deployment and use maven/ivy/gradle to build and retrieve and bundle everything.

      I guess the module system will have options to access a maven/ivy repository ... never deeply dug into it.

      I look at it from a teacher point of view: how to teach Java? So folks: "and as we have a complete unintuitive class with a static main method that prints our famous 'Hello World!', we only need to write a module description! And package everything into a jar file!"

      Simple, isn't it?

      Well, C programming also is 'complex' but those programmers usually know more about how computers actually work and why you need to link the o-files.

      Then again, I worked the last 2 years with companies that had trouble to get rid of Java 6 and migrate to 7, yes 7, not 8. I doubt I will have a Java 9 project in the next 5 years.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
  15. Is this 'modularity' as in nodejs? by fygment · · Score: 1

    It sounds like it's something along the lines of nodejs and npm. But frankly, the wording on anything about leaves the reader wondering, "Doesn't this already exist?"

    --
    "Consensus" in science is _always_ a political construct.
  16. Re:Now what about support for unsigned values for by kfh227 · · Score: 1

    You mean unassigned? I so read up on autoboxing.

    Autoboxing is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper classes. For example, converting an int to an Integer, a double to a Double, and so on. If the conversion goes the other way, this is called unboxing.

    If you use Integer classes instead of int primitives, you can assign null. But mathematical operations on those classes are still written like primitives.

  17. Re:Now what about support for unsigned values for by Travelsonic · · Score: 1

    I mean unsigned - as in, a value that can only be positive, versuses a signed value, which can be positive or negative. For example, an unsigned byte can have values from 0 to 255, whereas a signed byte value goes from -128 to +127

    --
    If you believe in privacy, and believe you have "nothing to hide" at the same time, you're a goddammed idiot
  18. Re:Now what about support for unsigned values for by billybob2001 · · Score: 1

    char is unsigned, works for me.

    Java Language Specification

    4.2. Primitive Types and Values

    The integral types are byte, short, int, and long, whose values are 8-bit, 16-bit, 32-bit and 64-bit signed two's-complement integers, respectively, and char, whose values are 16-bit unsigned integers [representing UTF-16 code units (Â3.1).]

  19. Re:Now what about support for unsigned values for by Travelsonic · · Score: 1

    I guess that is what I was thinking of when I talked about limited unsigned support in Java - it would be nice though if we could have unsigned bytes too, though.

    --
    If you believe in privacy, and believe you have "nothing to hide" at the same time, you're a goddammed idiot