Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Two Issues with OpenJDK 17 on Windows 10 64 bit Home.

  1. #1
    Junior Member
    Join Date
    Nov 2021
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Two Issues with OpenJDK 17 on Windows 10 64 bit Home.

    I have a tiny little Java OpenJDK 17 Module file, module-info.java,
    ---------------------------
    module JavaApplication
    {
    requires java.base;
    }
    ---------------------------
    and Netbeans 12.5 is giving me the following errors:

    C:\Users\User\Documents\NetBeansProjects\JavaAppli cation1\src\Java1\Start.java:1: error: file should be on source path, or on patch path for module
    package Java1;
    C:\Users\User\Documents\NetBeansProjects\JavaAppli cation1\src\Java1\module-info.java:1: error: file should be on source path, or on patch path for module
    module JavaApplication
    2 errors

    -If I have a Java application, where exactly am I supposed to put the module file itself, what do I do to get it to compile and insert correctly?
    Particularly in a Netbeans 12.5 Java Application?

    The originators of Java have posted a Java Enhancement Proposal statement on the web.
    What it refers to is the floating point arithmetic behaviour in Java 1.1.
    It also refers to SSE, a phenomenon in other language, such as C++.
    They do refer to the original floating support semantics
    that were there in version 1.1 of Java.

    What they are describing, in these terms, is floating point arithmetic without
    error phenomenon. A circumstance where:
    ---------------------------
    package Java1;

    import static java.lang.System.*;

    public class Start
    {
    public static void main(String[] args)
    {
    out.println("Greetings");

    out.println();

    float a = 0.1F;

    float b = 0.1F;

    float c = a*b;

    out.println(c);

    double d = 0.1D;

    double e = 0.1D;

    double f = d*e;

    out.println(f);

    out.println();

    out.println("Goodbye.");
    }
    }
    ---------------------------
    should prints the solution 0.01 in both instances, instead of

    0.010000001
    0.010000000000000002

    I am on Windows 10 64 bit Home, and am using Netbeans 12.5 successfully, but on
    top of Java OpenJDK 17.

    -Most importantly, JEP 306 refers to the adjustment of these very floating
    point calculations, such that this code example will output

    0.01
    0.01

    and nothing further, according to the language used on the JEP post.
    How can I get the latter defaulting floating point defaulting behaviour with
    OpenJDK 17?

  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Two Issues with OpenJDK 17 on Windows 10 64 bit Home.

    should prints the solution 0.01 in both instances, instead of

    0.010000001
    0.010000000000000002
    Yes, the computer does not hold floating numbers as precise as we would hope.
    There are some discussions here: http://docs.oracle.com/cd/E19957-01/..._goldberg.html

    For more technically competent programmers, try asking here:
    http://www.coderanch.com/forums
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Two Issues with OpenJDK 17 on Windows 10 64 bit Home.

    For more: https://coderanch.com/t/747172/java/...oint-Behaviour

    If you want precision use a class like BigDecimal.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 4
    Last Post: March 13th, 2019, 09:01 PM
  2. Issues with my ordering program - if statement issues?
    By Shenaniganizer in forum What's Wrong With My Code?
    Replies: 5
    Last Post: October 31st, 2012, 10:17 PM
  3. XMLBeans - how to control generated class files? windows vs linux issues
    By g20zoom in forum What's Wrong With My Code?
    Replies: 0
    Last Post: June 6th, 2012, 12:01 PM
  4. Replies: 1
    Last Post: February 3rd, 2012, 12:00 PM

Tags for this Thread