#Which JDK should I get?

1 messages · Page 1 of 1 (latest)

peak tinsel
#

From what I've seen Oracle and Openjdk are the best ones. People say Openjdk is the best one I keep seeing hate on Oracle. I don't know if I'm looking at the right thing rn thats why I'm asking. I'm on openjdk.org and it looks like a scam/virus. The site is so poorly built it can't possibly be better than Oracle. Should I get openjdk? How do I get it? Also, side note. Which IDE should I get? I heard eclipse and intellij are the best ones but idk which one to get.

green roseBOT
#

<@&987246527741304832> please have a look, thanks.

green roseBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

#

Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.

#

t could be confusing to choose between Oracle JDK and OpenJDK, as both are popular choices for Java Development Kits (JDKs). Here are some factors to consider:

  1. Oracle JDK: Historically, Oracle JDK was the most commonly used JDK for Java development. It provides long-term support (LTS) versions with regular updates and bug fixes. However, starting from Java 11, Oracle changed its licensing model, and commercial support is now available only through a paid subscription.

  2. OpenJDK: OpenJDK is an open-source implementation of the Java Development Kit. It is free to use and provides regular updates and bug fixes similar to Oracle JDK. Many developers prefer OpenJDK due to its open-source nature and community-driven development process.

When deciding which one to choose, consider the following:

  • Licensing: If you require commercial support or are developing software for commercial purposes, you may need to consider Oracle JDK's licensing terms. For most general-purpose applications or open-source projects, OpenJDK should suffice.

  • Compatibility: Both Oracle JDK and OpenJDK aim for compatibility with the Java SE specifications. However, some minor differences might exist due to separate development processes.

  • Community Support: OpenJDK benefits from a large community of contributors who actively maintain and improve it. This can result in faster bug fixes and enhancements compared to Oracle JDK.

In summary, if you are looking for a free and open-source option with good community support, OpenJDK is a suitable choice. However, if you require specific features or commercial support from Oracle, you might consider using their JDK version.

It's always recommended to check the official documentation and consult with your team or project requirements before making a final decision on which JDK to use.

cunning quest
# peak tinsel From what I've seen Oracle and Openjdk are the best ones. People say Openjdk is ...

From what I've seen Oracle and Openjdk are the best ones.
Just use OpenJDK https://adoptium.net/
I keep seeing hate on Oracle
...you know that java is made by oracle right?
I'm on openjdk.org and it looks like a scam/virus. The site is so poorly built
yes that's normal, it's because it is for openjdk development, not clients aka us

And use adoptium, it's where you should get it

it can't possibly be better than Oracle
Do you know the difference? It's licensing and additionnal services, that's all, it doesn't matter where you get it

Also, side note. Which IDE should I get? I heard eclipse and intellij are the best ones but idk which one to get.
IntelliJ, period

peak tinsel
#

also why is intellij better than eclipse? Does it have something eclipse doesnt

cunning quest
cunning quest
peak tinsel
#

can you send me the link where i download intellij? Ive looked for it but i cant find it anywhere

cunning quest
peak tinsel
#

alright that helps

#

thanks a lot

#

appreciate it

#

im doing the jdk rn. do i just keep clicking next to download it the way it does it default or is there anythign else i need to do?

#

there are two X's next to set java home variables and javasoft registry keys

cunning quest
peak tinsel
#

idk what that means

#

i just clicked the big button

#

to download

#

the Latest LTS Release

#

and then it opened the setup wizard

cunning quest
#

yes

#

what's the problem ?

peak tinsel
#

i'm just going along with it but there are two red X's which usually isnt good

#

the first page

#

after i click next in the home screen thing of the setup wizard

cunning quest
peak tinsel
#

it says "Set JAVA_HOME variables" and "JavaSoft (Oracle) registry keys" and theres two red x's

peak tinsel
#

it says Select the way you want features to be installed

#

It's the Custom Setup

#

It says Set Java Home variable and javasoft registry keys wont be available

#

the red x means the feature wont be available

torpid parcel
peak tinsel
#

i had problems in the past with python and PATH and variables and stuff so i just wanna make sure im doing things properly with Java

cunning quest
#

well

#

actually check all

peak tinsel
#

what do they do

#

and why arent they on by default

#

for the bottom one it says

#

"Overwrites the reg keys HKLM\software...\javapath' does not work. You need to reinstall it to recreate these registry keys"

#

what doesnt work?

#

and whats an environment variable

torpid parcel
peak tinsel
torpid parcel
#

Add to path is on by default ?, i haven't used this installer so im not familiar that much.

peak tinsel
#

oh no

#

not that one

#

on the pic i sent

#

the 2 bottom ones arent on by default

#

what are those ones

cunning quest
#

it's not important, you don't need to check it if you don't want

peak tinsel
torpid parcel
#

JAVA_HOME is just a variable that holds address of your jdk installation folder

peak tinsel
cunning quest
peak tinsel
#

so do i just keep it the way it is default?

#

the two bottom ones unchecked?

#

or do i check the java home variables

#

also whats Eclipse Temurin? Is it the name of the software im installing or the IDE?

cunning quest
cunning quest
cunning quest
peak tinsel
#

oh okok

#

so i check the first 3 but dont check the javasoft registry keys?

cunning quest
#

yes

#

also

#

before

#

unsiltall any version of java you might have

peak tinsel
#

i dont have any

cunning quest
#

pretty sure you do

#

windows usually comes with some old version of java

peak tinsel
#

i did a factory reset a few days ago and didnt install anything other than chrome and discord and a few random stuff

#

oh

cunning quest
#

so press windows key and enter java

#

and you will see

peak tinsel
#

nope i dont have anything

cunning quest
#

right

peak tinsel
#

only thing that shows up is the answers from the web

cunning quest
#

when installed

peak tinsel
#

like it shows bing and stuff

cunning quest
#

open cmd and enter where java

#

just to be sure

peak tinsel
#

in the cmd i type "java"?

torpid parcel
#

also don't be too stressed out with setting up path (environment variables), you can change that anytime if you wish to later. But i get it's a bit tricky to set up early on.

cunning quest
peak tinsel
torpid parcel
#

do what alath suggested

peak tinsel
cunning quest
#

alright

#

so install it

peak tinsel
#

alright

#

ok i got it now im gonna do intellij

#

for the Choose Install Location do i just keep it at default?

#

and for the Installation Options theres a bunch of stuff

torpid parcel
cunning quest
peak tinsel
#

first 3 meaning create desktop shortcut, update PATH, and update context menu

#

alright

#

what exactly is this PATH thing that shows up everywhere

torpid parcel
#

just context for you to run commands basically, like i mentioned for java

cunning quest
# peak tinsel first 3 meaning create desktop shortcut, update PATH, and update context menu
  • Create Desktop Shortcut is so you can open it from windows menu
  • Update Context Menu is so you can open a folder with IntelliJ by right clicking
  • Path is so you have access to the command, very important for java, since you need it to run java, not really important for intellij, since you won't open it often like this, but still usefull

And you can select the associations if you want

peak tinsel
#

what are associations?

cunning quest
peak tinsel
#

sorry if im asking a bunch of questions haha im paranoid bc of what happened with python i had to delete python and reset everything

torpid parcel
#

anytime you launch files with these extentions, intellij will be used as default program.

peak tinsel
#

ohhh i see

#

its like those default things on your computer that you set like to open chrome default for x type of file

cunning quest
peak tinsel
cunning quest
peak tinsel
#

what's Choose Start Menu Folder

#

"Select the start menu folder in which you would like to create the program's shortcuts. You can also enter a name to create a new folder"

cunning quest
#

show a screenshot please

peak tinsel
#

ohhh i get it haha

#

self explanatory

#

it just asks me to select one of the folders i have on my pc to create the shortcuts

cunning quest
#

wdym

#

ah

peak tinsel
#

by default it made it so that it created a folder called JetBrains to create any shortcuts

#

i just left it at that

#

or else it would create shortcuts and put it in random folders i have

#

which would just be unecessarily disorganized

#

ok i downloaded it

#

is there anything i need to do now?

#

to link the jdk to the ide or something

#

idk

cunning quest
#

first open cmd

#

enter where java

peak tinsel
#

there

#

now it gives me a path to java.exe

cunning quest
#

right

#

and also do echo %JAVA_HOME%

peak tinsel
#

what does that do?

cunning quest
#

print the content of JAVA_HOME

peak tinsel
#

that gives me a path to jdk-21.0.1.12-hotspot\

cunning quest
#

right

#

everything is fine

peak tinsel
#

its the same path as the one to java.exe except after it goes hotspot\bin\java.exe

cunning quest
#

now try to create a project with intellij

#

also note that you actually don't need to install java to use intellij

#

it already comes with a few versions of java

peak tinsel
#

oh

#

haha

#

well

#

now i have the newest one

#

and the other development tools like the debugger and stuff which i dont think it comes with

#

but whatever

#

im creating a project rn

#

whats Git repository

peak tinsel
#

like the jdk comes with a bunch of tools doesn tit

#

doesn't it*

torpid parcel
cunning quest
peak tinsel
#

oh

cunning quest
peak tinsel
#

wait so whats the jdk for?

#

if the ide already has java

cunning quest
#

it already has a JDK yes

#

you could have simply just installed intellij

#

but if you did that

#

you wouldn't be able to use java outside of intellij

peak tinsel
#

ohhh i see

#

i created a project

#

im on it right now

#

now what

#

do i run it and its gonna work?

cunning quest
#

try yes

peak tinsel
#

wait theres 2 buttons to run

#

Alt + 4
and
Shift + F10

cunning quest
#

show the icons

peak tinsel
#

they're both play buttons

#

Shift F10 one is green on top of my screen

#

and the Alt 4 one is in the left corner

cunning quest
#

show the icosn please

#

or a screenshot

peak tinsel
#

alright

#

I think the green one only runs the Main class and the other one runs the whole thing

cunning quest
peak tinsel
#

bottom left corner

cunning quest
#

show a screenshot of the whole thing please

peak tinsel
#

wait what

#

now one is gone

cunning quest
#

there are 3 run buttons here

#

the two at the left

#

which will specifically run the main class/method

peak tinsel
#

yeah

cunning quest
#

the top right which will guess what you want to run (actually will just run the main class/last thing you ran)

#

and also, at the right of the run button, there is a button looking like a bug

#

it's the debug button

peak tinsel
#

yeah

#

i dont know how to use a debugger

#

i never used one

#

i used to use print statements

cunning quest
#

I advise you to use it instead of the run button when possible

peak tinsel
#

what does it do?

#

i just did it and it didnt do anything

#

if i run something and thers an error its gonan say "syntax error" or something and the line

#

so what does the debugger do different

cunning quest
# peak tinsel i never used one

by clicking on the line number, you can set a breakpoint, and when java reaches it, it will pause, allowing you check the content of the variables, and allowing you to run it line by line

peak tinsel
#

oh

#

i thought those breakpoints were used just to skip a line

cunning quest
peak tinsel
#

it works yeah

#

it prints

cunning quest
#

right

peak tinsel
#

and the for loop works too

cunning quest
#

so now, set a breakpoint on the print

#

and try to use the debugger

peak tinsel
#

tf

#

woah

#

thats a lot of stuff

cunning quest
#

note that once a breakpoint is reached, and you want to advance line by line, you can use a button at the bottem left

peak tinsel
#

how is that useful tho?

#

like i can make the program pause at a certain line

#

what does that help with

cunning quest
#

it helps you to understand what is happening

#

it's not always easy to just look at the code and completly understand what it does

#

even less when there is a bug and you have no idea where it is, then what do you do ? do you put prints everywhere, or do you use the debugger ?

peak tinsel
#

well

#

if theres an error

#

it gives me the line

cunning quest
#

what if there isn't any error ?

peak tinsel
#

ohh

#

i see what you mean

#

yeah

cunning quest
#

and what if the error is too vague to help you ?

peak tinsel
#

debugger probably helps

cunning quest
#

it's not probably

#

pretty sure you will love using it in the first assignment you will have

#

and in all the following assignments

peak tinsel
#

i see

#

hold up

#

i have one random question that i dont really get

#

i used to use vscode for python

#

people say its bad for java

cunning quest
#

indeed

peak tinsel
#

i headr somewhere that its a text editor

#

not an ide

#

what exactly is vscode

#

like it runs coe

#

code

#

is that not what an ide does

cunning quest
#

it can become an ide if you crank up enough extensions

#

kinda

peak tinsel
#

i hated extensions

#

theyre so complicated

#

i only ever used the ones made by microsoft because they all worked the same way

cunning quest
#

Java IDEs like intellij are so much powerful, that even VSCode with extensions is nowhere close

#

and if you don't use extensions at the first place

peak tinsel
#

so what is it good for?

#

vscode

cunning quest
#

using vscode is probably the worst idea

peak tinsel
#

my friend who got me into programming only uses vscode thats why its the first one i tried

cunning quest
peak tinsel
#

yeah but like

cunning quest
#

vscode is good with everything, but is best for nothing

peak tinsel
#

wait hold on what is an ide

#

what does intellij have that vscode doesnt

cunning quest
#

Integrated Development Environment

cunning quest
peak tinsel
#

with 0 extensions

cunning quest
#

It probably won't even have auto completion then

peak tinsel
#

nope

cunning quest
#

which is like, bare minimum

#

also note that java has a repl

#

it's the command jshell

peak tinsel
#

python does too right

cunning quest
#

yes

peak tinsel
#

its like where you write code or commands while running the program

cunning quest
#

it's where you can dynamically execute whatever you enter

#

try running jshell command

#

then enter 2+2

peak tinsel
#

how do i open the shell

cunning quest
#

open cmd

#

and enter jshell

peak tinsel
#

ohh on my computer not intellij

cunning quest
#

well

#

you can also do that on intellij

#

intellij has a console afterward

peak tinsel
#

wait hold on so jshell does what exactly

#

on my computer

cunning quest
#

take a screenshot

peak tinsel
#

hold up

#

i type jshell

#

it says

#

| Welcome to JShell -- Version 21.0.1
| For an introduction type: /help intro

#

then i say 2+2

cunning quest
#

right

peak tinsel
#

and it says

cunning quest
#

so you launched jshell

peak tinsel
#

$1 ==> 4

cunning quest
#

4

#

yes

#

2+2=4

peak tinsel
#

yeah

cunning quest
#

you can enter System.out.println("hello")

peak tinsel
#

i thought id have to type in java code

cunning quest
#

like regular java

peak tinsel
#

yeah like that

#

like System.out.println(2+2)

cunning quest
cunning quest
#

no need to print

peak tinsel
#

ohh thats cool

#

alright alright i see

#

this is cool

cunning quest
#

so if you just want to enter some code online

peak tinsel
#

i have openjdk

#

does every jdk have the same java

#

like is java one thing

#

and then each jdk has like other stuff included

#

or is the java slightly different in each jdk

cunning quest
#

it's the same

#

like I said earlier

#

only difference is license and additional services

peak tinsel
#

oracle comes with additional services

#

yeah

cunning quest
#

and different license

peak tinsel
#

yeah

#

alright that makes sense

cunning quest
#

every vendor just build it from here, stick a license they like and distribute it

peak tinsel
#

whats a lisence

#

branding?

#

like i can just take that put my name on it and distribute it?

cunning quest
#

It's basically a permit to use something, under certain terms

peak tinsel
#

ohhh

cunning quest
peak tinsel
#

i see

#

like openjdk might let me create something and sell it but oracle might not

#

stuff like that

cunning quest
#

yea

peak tinsel
#

i see

#

i appreciate the help man

#

now i can learn java 🙂

warm jewel