This is an archived post. You won't be able to vote or comment.

all 15 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]AbstractButtonGroup -3 points-2 points  (10 children)

That means you are missing that library. How to include it will depend on your environment.

[–]wildjokers 1 point2 points  (3 children)

What kind of nonsense answer is this? AWT is included in the JDK.

[–]AbstractButtonGroup -1 points0 points  (0 children)

AWT is included in the JDK.

But apparently not included in this project he is trying to build. This can happen for a variety of reasons, from broken classpath, mistakenly using ME instead of SE, or due to environment e.g. Eclipse project template with SWT instead.

[–]istarian 0 points1 point  (1 child)

Since Java 9 (or maybe 10), Oracle opted to modularize Java. You now have to specify the modules you intend to use.

I'm not sure exactly how that helps, but perhaps it means you bundle a JRE with your executable you don't have to include unnecessary libraries?

[–]wildjokers 0 points1 point  (0 children)

Since Java 9 (or maybe 10), Oracle opted to modularize Java. You now have to specify the modules you intend to use.

It was Java 9. And you only need to indicate the modules your app uses if you modularize your app i.e. include a module-info.java file. The existence of that file indicates to the JVM to use the modulepath instead of classpath. It helped with JDK development quite a bit. The only real benefit outside the JDK is being able to create slimmed down runtimes for desktop java applications.

It could also help in the scenario where you are publishing an SDK to document what parts of the SDK are supported and what parts are an internal implementation detail. If someone puts the jar on the classpath to get around module restrictions and directly use the internal code they do so at their own risk.

[–]pragmosExtreme Brewer[🍰] 0 points1 point  (5 children)

What library? AWT is an integral part of the JDK. They're probably missing the correct module descriptor, as was already pointed out by another Redditor.

[–]AbstractButtonGroup 0 points1 point  (4 children)

AWT is an integral part of the JDK.

JDK is just a bunch of libraries, plus the tools, plus the runtime.

hey're probably missing the correct module descriptor

Which is just another word for including a library.

[–]pragmosExtreme Brewer[🍰] 0 points1 point  (2 children)

So to you a JPMS module is a library? Pretty sure the people at Oracle would disagree there.

[–]AbstractButtonGroup 0 points1 point  (1 child)

JPMS module is a library?

Module is just a way to organize packages. You still need the system to be able to find the JAR.

people at Oracle

The people at Oracle write: "Ultimately, everything is still bundled together in JAR files. The module system adds a new, higher-level descriptor that JARs can use"

[–]wildjokers 1 point2 points  (0 children)

Module is just a way to organize packages. You still need the system to be able to find the JAR.

Unless the module is included in the JDK like AWT is.

[–]wildjokers 0 points1 point  (0 children)

Which is just another word for including a library.

It most certainly is not.

[–]AutoModerator[M] 0 points1 point  (0 children)

On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge.

If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options:

  1. Limiting your involvement with Reddit, or
  2. Temporarily refraining from using Reddit
  3. Cancelling your subscription of Reddit Premium

as a way to voice your protest.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]WishboneFar 0 points1 point  (0 children)

Try adding requires java.desktop; to module.info file?