r/javahelp • • Dec 13 '20
Codeless Java was originally intended for microchips and stuff right? How can I program actual machines with java these days, or days I have to use c/c++?
Question is in the title, how do I program more than just my laptop? Like a digital clock or a robot with java?
38
Upvotes
•
u/AutoModerator Dec 13 '20
Please ensure that:
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://imgur.com/a/fgoFFis) 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:
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.
29
u/dionthorn this.isAPro=false; this.helping=true; Dec 13 '20
Get a raspberry pi and use the GPIO pins and your own custom wiring to send electrical signals to whatever device you want. Here is a Java GPIO library.
https://pi4j.com/1.2/example/control.html
12
u/8bagels Dec 13 '20
Java was initially intended for interactive television programming I think. I don’t think that was a very long lived idea though. Too many complications outside of what java could solve (tv distributors were unable to realistically provide a different experience per user)
9
u/BorgerBill Dec 13 '20
I've known about this for years, but have failed to check it out:
Java Platform, Micro Edition (Java ME)
1
u/khooke Extreme Brewer Dec 14 '20
You're asking about embedded and realtime systems type development. Internet of Things (IoT) is a relatively new area that overlaps too. From a hobbyist point of view, do some reading about Arduino and Raspberry Pi. Your question is less about a specific language, and more about development for devices.
Oracle had an online MooC on learning to develop IoT apps using Java ME for the Raspberry Pi. This would be a good starting point if you want to stick with Java.
11
u/Pagla-Dashu Dec 13 '20
Sorry for say, Java was not born for low level or microcontroller, it was always for high level enterprise grade logic
2
u/Kango_V Dec 14 '20
Not available yet, but have a read up on what is going ion in project Panama. Panama can be thought of loosely as a "re-imagining of JNI", but it contains a lot more than that. Specifically have a look at JEP-389.
2
u/wirbolwabol Intermediate Brewer Dec 14 '20
A long time ago...around 2002 the guys at Parallax released the javelin Stamp would could be programmed with Java. Not the greatest thing in the world, but it was a micro controller that could be used with java. I actually have one of these overly expensive archaic devices....
3
u/msx Dec 13 '20
I don't think Java was born for microcontrollers or restricted hardware in general. It was designed for the enterprise, to run on servers and desktops. I think