Installing the Java JDK
Needed for CSC 4240
Begin your journey here. Go to the adoptium.net and do the following. The site automatically detects your OS and offers the correct version.
- Download the Latest LTS release.
- Run the installer. Then do this in a command window. If you run
linux, use
--version
to see the version. This works on MacOSX and Windoze. You will see your version of Java print out.
Create this file using your text editor.
public class TestJava { public static void main(String[] args) { System.out.println("Passed!"); } }
Navigate your cmd or terminal to the folder containing this file. Then (the $ below is your system prompt), type
$ javac TestJava.java
to compile and
$ java TestJava Passed!
to run. You are ready to run and compile Java, and you have all you need for 4240.
Installing the JavaFX JDK
Needed for CSC 4280
- Go to The BellSoft Site.
- Click on Download Current or LTS Release.
- Scroll down the page to find your OS.
- Select your chip.
- Pull down the menu next to the Package label and select FULL JDK.
Restart your command window session if you have one open.
Testing your JavaFX Install
Make this file in a text editor.
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
import javafx.scene.control.Button;
public class HelloFX extends Application {
@Override
public void start(Stage stage) {
String javaVersion = System.getProperty("java.version");
String javafxVersion = System.getProperty("javafx.version");
Button b = new Button("Quit");
Label l = new Label("Hello, JavaFX " + javafxVersion
+ ", running on Java " + javaVersion + ".");
BorderPane bp = new BorderPane();
bp.setCenter(l);
bp.setTop(b);
b.setOnAction(e -> System.exit(0));
Scene scene = new Scene(bp, 640, 480);
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
launch();
}
}
Now compile and run using the command line. This window should pop up on your screen.
Click on the quit button to dismiss it.