Stock image from Pexels

Discord Bots with Javacord: Installing the JDK

Caleb Garcia
Java Playground
Published in
3 min readJul 31, 2020

--

Do you want to make a bot custom-made for your Discord server, but just don’t know where to start or what to use?

By coding a Discord bot in Java, you’re learning the very valuable skill of software programming, and you’re learning it with a widely used programming language. Java is used worldwide for all sorts of web applications, desktop applications, mobile apps, and much more. Coding a Discord bot in Java is an amazing way to get yourself into programming, and it’s a perfect introduction to working with the Java programming language.

Coding a Discord bot allows you to do a wide variety of things to spice up any server; whether you want to automate managing your server’s roles, welcome new members to your community, or get a drawing prompt for the artists in your server. Learning to code your own Discord bot allows you to do all of these things, plus whatever else you could want for your server!

Before you can start the coding process, you have to install what’s called the Java Development Kit, or the JDK, on your computer. This is what enables you to write code in Java, and it’s what allows your code editors to work with Java. To install the JDK, go to this link and click on JDK Download under Oracle JDK. From here, scroll to the bottom of the table and download the Windows x64 installer file. Make sure to accept Oracle’s License Agreement when the window appears.

When you run the freshly-downloaded setup file, you’ll click “Next” twice, and then “Close” the window after it finishes installing. After the JDK has been installed, the last thing task to set up Java is to add the directory of the JDK’s “bin” folder on your computer to the PATH variable. First, open your File Explorer and navigate to C:\Program Files\Java\jdk-1x\bin. Right click on “bin” in the directory bar and click “Copy Address”. After you do this, open your Control Panel and follow this path: Control Panel > System and Security > System > Advanced System Settings > Environment Variables. In the lower box, double-click “Path”, and in the new window click “New”, and type Ctrl+V to paste in the JDK directory. From here click “OK” on the last three windows, and close the rest.

Congratulations! You’ve completed the first step towards coding your very own Discord bot in Java! Now that you’ve installed the JDK, you can download the IntelliJ IDE (Community Edition) that you’ll be using to work your magic. I’ll be writing a continuation of this coding series soon; if you subscribe to The Playground Digest newsletter, you’ll be the first to know when it comes out.

Make sure to follow me to see more articles like this one, and if you know somebody who wants to get in to programming, have them read up on getting started with Java!

If you’d like me to code a custom Discord bot for your server using the methods described in this series, check out my Fiverr®️ Gig®️ here!

--

--

Caleb Garcia
Java Playground

Hello! My name is Caleb Garcia and I’m a programmer who would love to give you some of his coding experience, so you can make better decisions in your projects.