Where Java Runs
- Terminology and concepts to look out for: application · back end · library
- Relevance to me: You now know where Java came from and why people chose it. Today you look at where it actually runs, including places you never see, such as the systems that package AI.
- Board Question: Name one app or website you used this week. Do you think any Java was running somewhere when you used it? Answer yes or no, and name where it might have been running.
Open the discussion form on the right and answer Section 1 from your first reading.
Where Java Runs
This section explains where Java programs run, what the back end of an application does, and what part Java plays in packaging AI.
Java source code is written in plain text files, and a compiler turns those files into bytecode. Bytecode is the machine language of the Java Virtual Machine, which runs the program. The Java Virtual Machine is available on many operating systems, so the same bytecode can run on Windows, on Linux and on a Mac. That is why Java is called portable.
Applications and Their Back Ends
An application is a program that people use to get a task done, such as a banking app, a game or a map. Many applications have two parts. The part on a phone or laptop screen is the front end, which shows information and collects what the user types or taps. The back end is the part of an application that runs on servers, where it stores the data, does the work and sends results back to the front end. Only its results reach the user's screen, so the user never sees the back end. For example, a bank's back end stores account information and lets only the right people view an account, while the front end shows the balance. The screen a customer taps on is the front end, not the back end, because the back end runs on servers the customer never sees.
A language model by itself is not an application. It becomes part of an application only when a program carries a person's question in and the answer back out.
Places Java Runs
Android apps are written in Java or Kotlin, and since 2019 Google has recommended that new Android apps start with Kotlin. Oracle, the company that leads Java's development, calls Java the language of choice for business applications.
Big-data tools also run Java. Apache Kafka moves streams of data between systems. Apache Hadoop processes large sets of data on groups of up to thousands of computers. Elasticsearch searches and analyzes stored data. The code of all three projects is written mostly in Java, and Kafka's second language is Scala. Kafka's project page reports that 7 of the 10 largest banks use it. So Java runs in the back ends of most of the largest banks.
Minecraft: Java Edition, which its store page calls the original version of the game, runs on Windows, macOS and Linux. A Java Edition server cannot start until a Java runtime has been installed.
Libraries
A library is code that someone else already wrote and tested, which a program can use instead of writing that part again. Java's standard library comes with Java. Oracle describes it as a large collection of ready-made parts, grouped into packages of related code. Many other Java libraries are free to use, and Spring AI and LangChain4j are two of them. A Java library is code that a program uses for one part of its job, so it is different from a building full of books and smaller than a whole application.
Java in an AI Tool
The back end of an AI tool is the program that receives the user's question, adds the system prompt, sends the request to the model and returns the answer to the front end. A request to a Mistral model names the model and carries a list of messages, each with a role such as system or user. Figure 1 shows this path from left to right, with Java in the back end.
That back end can be written in Java, and a library can do the work of calling the model. LangChain4j's stated goal is to make it simpler to connect language models to Java applications. It works with more than 20 model providers. Spring AI is written in Java, and it can call the models from Mistral AI and from other companies.
The model itself is usually built with a different language. GitHub reported in 2024 that Python is used heavily for machine learning and is the top language for data science and research. PyTorch, a library for building deep-learning models, is written mostly in Python, with large parts in C++. Python does not do all of the work, and the back end around the model can be written in Java. On Friday, the class looks at the course where students learn to read and write Java, which is AP Computer Science A.
Summary
An application is a program people use to get a task done, and its back end runs on servers that the user never sees. Java runs in Android apps, in bank back ends, in big-data tools such as Kafka, Hadoop and Elasticsearch, and in Minecraft: Java Edition. In an AI tool, a Java back end can use a library such as Spring AI or LangChain4j to call a model, which is usually built with Python.
Sources: Oracle, About the Java Technology (n.d.); MDN, Introduction to the server side, What is JavaScript? and UI (n.d.); Android Developers, Application fundamentals (n.d.); Android Developers, Android's Kotlin-first approach (n.d.); Oracle, Java (n.d.); Apache, Apache Kafka (n.d.); Apache, Apache Hadoop (n.d.); Elastic, elasticsearch repository (n.d.); Microsoft Store, Minecraft: Java Edition (n.d.); Mojang, Minecraft Server Download (n.d.); Spring, Spring AI Reference (2026); LangChain4j, Introduction (n.d.); Mistral AI, Chat Completion API (n.d.); GitHub, Octoverse 2024 (2024); PyTorch, PyTorch documentation (n.d.).
-
notebook cue: application
A student opens a banking app to check a balance. What makes the banking app an application?
Check
It is a program that people use to get a task done, and here the task is checking a balance. It also has the two parts many applications have: the front end on the phone shows the balance, and the back end on the bank's servers stores the account information. See Applications and Their Back Ends, paragraph 1.
-
notebook cue: back end
In an AI tool, which part adds the system prompt and sends the request to the model: the front end or the back end? Where does that part run?
Check
The back end does it, and the back end runs on servers that the user never sees. It receives the user's question, adds the system prompt, sends the request to the model and returns the answer to the front end. See Java in an AI Tool, paragraph 1, and Figure 1.
-
notebook cue: library
A programmer uses LangChain4j instead of writing her own code for calling a model. What is LangChain4j, and what does it save her?
Check
LangChain4j is a Java library, which is code that someone else already wrote and tested. It saves her from writing and testing her own code for calling a model, and it already works with more than 20 model providers. See Libraries and Java in an AI Tool, paragraph 2.
-
notebook cue: application
A student opens a banking app to check a balance. What makes the banking app an application?
Check
It is a program that people use to get a task done, and here the task is checking a balance. It also has the two parts many applications have: the front end on the phone shows the balance, and the back end on the bank's servers stores the account information. See Applications and Their Back Ends, paragraph 1.
-
notebook cue: back end
In an AI tool, which part adds the system prompt and sends the request to the model: the front end or the back end? Where does that part run?
Check
The back end does it, and the back end runs on servers that the user never sees. It receives the user's question, adds the system prompt, sends the request to the model and returns the answer to the front end. See Java in an AI Tool, paragraph 1, and Figure 1.
-
notebook cue: library
A programmer uses LangChain4j instead of writing her own code for calling a model. What is LangChain4j, and what does it save her?
Check
LangChain4j is a Java library, which is code that someone else already wrote and tested. It saves her from writing and testing her own code for calling a model, and it already works with more than 20 model providers. See Libraries and Java in an AI Tool, paragraph 2.
Where Java Runs
This section explains where Java programs run, what the back end of an application does, and what part Java plays in packaging AI.
Java source code is written in plain text files, and a compiler turns those files into bytecode. Bytecode is the machine language of the Java Virtual Machine, which runs the program. The Java Virtual Machine is available on many operating systems, so the same bytecode can run on Windows, on Linux and on a Mac. That is why Java is called portable.
Applications and Their Back Ends
An application is a program that people use to get a task done, such as a banking app, a game or a map. Many applications have two parts. The part on a phone or laptop screen is the front end, which shows information and collects what the user types or taps. The back end is the part of an application that runs on servers, where it stores the data, does the work and sends results back to the front end. Only its results reach the user's screen, so the user never sees the back end. For example, a bank's back end stores account information and lets only the right people view an account, while the front end shows the balance. The screen a customer taps on is the front end, not the back end, because the back end runs on servers the customer never sees.
A language model by itself is not an application. It becomes part of an application only when a program carries a person's question in and the answer back out.
Places Java Runs
Android apps are written in Java or Kotlin, and since 2019 Google has recommended that new Android apps start with Kotlin. Oracle, the company that leads Java's development, calls Java the language of choice for business applications.
Big-data tools also run Java. Apache Kafka moves streams of data between systems. Apache Hadoop processes large sets of data on groups of up to thousands of computers. Elasticsearch searches and analyzes stored data. The code of all three projects is written mostly in Java, and Kafka's second language is Scala. Kafka's project page reports that 7 of the 10 largest banks use it. So Java runs in the back ends of most of the largest banks.
Minecraft: Java Edition, which its store page calls the original version of the game, runs on Windows, macOS and Linux. A Java Edition server cannot start until a Java runtime has been installed.
Libraries
A library is code that someone else already wrote and tested, which a program can use instead of writing that part again. Java's standard library comes with Java. Oracle describes it as a large collection of ready-made parts, grouped into packages of related code. Many other Java libraries are free to use, and Spring AI and LangChain4j are two of them. A Java library is code that a program uses for one part of its job, so it is different from a building full of books and smaller than a whole application.
Java in an AI Tool
The back end of an AI tool is the program that receives the user's question, adds the system prompt, sends the request to the model and returns the answer to the front end. A request to a Mistral model names the model and carries a list of messages, each with a role such as system or user. Figure 1 shows this path from left to right, with Java in the back end.
That back end can be written in Java, and a library can do the work of calling the model. LangChain4j's stated goal is to make it simpler to connect language models to Java applications. It works with more than 20 model providers. Spring AI is written in Java, and it can call the models from Mistral AI and from other companies.
The model itself is usually built with a different language. GitHub reported in 2024 that Python is used heavily for machine learning and is the top language for data science and research. PyTorch, a library for building deep-learning models, is written mostly in Python, with large parts in C++. Python does not do all of the work, and the back end around the model can be written in Java. On Friday, the class looks at the course where students learn to read and write Java, which is AP Computer Science A.
Summary
An application is a program people use to get a task done, and its back end runs on servers that the user never sees. Java runs in Android apps, in bank back ends, in big-data tools such as Kafka, Hadoop and Elasticsearch, and in Minecraft: Java Edition. In an AI tool, a Java back end can use a library such as Spring AI or LangChain4j to call a model, which is usually built with Python.
Sources: Oracle, About the Java Technology (n.d.); MDN, Introduction to the server side, What is JavaScript? and UI (n.d.); Android Developers, Application fundamentals (n.d.); Android Developers, Android's Kotlin-first approach (n.d.); Oracle, Java (n.d.); Apache, Apache Kafka (n.d.); Apache, Apache Hadoop (n.d.); Elastic, elasticsearch repository (n.d.); Microsoft Store, Minecraft: Java Edition (n.d.); Mojang, Minecraft Server Download (n.d.); Spring, Spring AI Reference (2026); LangChain4j, Introduction (n.d.); Mistral AI, Chat Completion API (n.d.); GitHub, Octoverse 2024 (2024); PyTorch, PyTorch documentation (n.d.).
Each table picks one app that everyone has used, agrees on whether Java was likely running somewhere behind it, and names the place.
Chromebooks stay closed while your table talks. Sections 1 and 2 of the discussion form are already done. After you talk, finish Section 3 right here under My View. Submit before the exit ticket.
This form has three sections. Section 1: answer today's Board Question. Section 2: after the reading. Section 3 opens later in class. Today's Board Question: Name one app or website you used this week. Do you think any Java was running somewhere when you used it? Answer yes or no, and name where it might have been running.
CR 1. Board Question: Name one app or website you used this week. Do you think any Java was running somewhere when you used it? Answer yes or no, and name where it might have been running. Give your answer and one reason.
Write your answer in your lab notebook, labeled CR 1.
MC 1. Think about your answer to the board question. Name one app or website you used this week. Do you think any Java was running somewhere when you used it? Answer yes or no, and name where it might have been running. Which position is closest to yours now?
- No. Java is old, and the apps I use do not run it anymore.
- Yes, probably. It may not be on my screen, but it is likely running in the back end on a server.
- Only if the app shows a Java logo somewhere on the screen.
MC 2. (Reading claim 1) Most AI models are trained using Java.
- Agree
- Disagree
MC 3. (Reading claim 2) The back end of an application runs on servers that the user does not see.
- Agree
- Disagree
MC 4. (Reading claim 3) A library is code that someone else wrote, which a program can use.
- Agree
- Disagree
MC 5. (Reading claim 4) Kafka, Hadoop and Elasticsearch are written mostly in Python.
- Agree
- Disagree
MC 6. (Reading claim 5) In an AI tool, the front end adds the system prompt before the request reaches the model.
- Agree
- Disagree
MC 7. (Reading claim 6) LangChain4j and Spring AI are Java libraries that can do the work of calling a model.
- Agree
- Disagree
MC 8. (Reading claim 7) In the word BRIDGE, the letter at position 3 is I.
- Agree
- Disagree
MC 9. (Reading claim 8) The range from 2 up to but not including 6 holds 4 letters.
- Agree
- Disagree
CR 2. (A different view) Write the view at your table that was most different from yours. If everyone agreed, write the strongest argument against your table's answer.
Write your answer in your lab notebook, labeled CR 2.
CR 3. Think about the Board Question again: Name one app or website you used this week. Do you think any Java was running somewhere when you used it? Answer yes or no, and name where it might have been running. Do you have the same opinion as when you first answered the board question? If it is the same, what from the reading or table talk reaffirmed your opinion? If it is different, what from the reading or table talk changed your opinion?
Write your answer in your lab notebook, labeled CR 3.