-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
118 lines (98 loc) · 5.88 KB
/
index.html
File metadata and controls
118 lines (98 loc) · 5.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE html>
<html lang="en">
<head>
<title>JavaFX in IntelliJ</title>
<link type="text/CSS" rel="stylesheet" href= "stylesheet.css"/>
</head>
<body>
<!-- Navigation bar -->
<nav class="navbar">
<ul>
<li><a href ="#Introduction">Introduction</a>
<li><a href ="#Scenebuilder">Scenebuilder</a>
<li><a href ="#JDK 1.8">JDK 1.8</a>
<li><a href ="#OpenJFX">OpenJFX</a>
</ul>
</nav>
<!-- intro text -->
<h1 id="Introduction">How to get JavaFX to work with IntelliJ.</h1>
<h2>Introduction</h2>
<p>If you are taking the class DAPE1400 Programming at OsloMet,
you will need to use JavaFX together with IntelliJ to study
the topic of graphical interfaces with Java.
Unfortunately, JavaFX is not being included in JDK past version 1.8.
This means that you have two options.
The first is to install a version of JDK that is 1.8 or earlier and
select that every time you want to create JavaFX project.
The other option is to install OpenJFX and perform a series of operations
every time you want to create a JavaFX project.
</p><br>
<!-- text 1 -->
<h2 id="Scenebuilder">Scenebuilder</h2>
<p>You will need to download and set up Scenebuilder no matter which method you choose.
Download it by using the <a href=" https://gluonhq.com/products/scene-builder/" target="_blank">link</a> below. In IntelliJ,
go to File → Settings → Languages & Frameworks → JavaFX.
Select the correct path. In Windows, it will be
“C:\Program Files\SceneBuilder\SceneBuilder.exe”
if you have selected the default install location.
<br>
<br>
Relevant links:<br>
<a href=" https://gluonhq.com/products/scene-builder/" target="_blank">Dowload Scenebuilder</a>
</p><br>
<!-- text 2 -->
<h2 id="JDK 1.8">Using JDK 1.8</h2>
<p>Download version 1.8 of the JDK on the <a href="https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html" target="_blank">Oracle website.</a>
You will need to <a href="https://profile.oracle.com/myprofile/account/create-account.jspx" target="_blank">create an Oracle account</a> and verify your e-mail address.
By doing so you agree to receive marketing material from Oracle. You can <a href="https://go.oracle.com/unsubscribe?l_code=en-us&vn=MPRF" target="_blank">unsubscribe on this website</a> by entering your e-mail address.
Run the installer and install the JDK in the recommended location.
To create a JavaFX project, select New Project → JavaFX in IntelliJ. In the Project SDK field use the drop-down menu to select Java version 1.8.
IntelliJ will have detected the installation automatically. If the version has not been auto-detected, you will need to locate it manually by selecting
“Add JDK…” in the same menu and selecting the location where it was installed.
<br>
<br>
Relevant links:<br>
<a href="https://profile.oracle.com/myprofile/account/create-account.jspx" target="_blank">Create Oracle account</a>
<br>
<a href="https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html" target="_blank">Download Java SDK 1.8</a>
<br>
<a href="https://go.oracle.com/unsubscribe?l_code=en-us&vn=MPRF" target="_blank">Unsubscribe Oracle marketing</a>
</p><br>
<!-- text 3 -->
<h2 id="OpenJFX">Using OpenJFX</h2>
<p>First, make sure you have JDK 15. If not, download it from the
<a href"https://www.oracle.com/java/technologies/javase-downloads.html" target="_blank">Oracle website.<a><br>
Next, download JavaFX 15 from the <a href="https://openjfx.io/" target="_blank">OpenJFX website.<a>
Select the “SDK” for your operating system.
Install the software in an appropriate location. I recommend “.../Program Files/Java” if you are on Windows.
Make sure not to install it over the actual JDK folder. In any case, take note of where you have installed the software,
as you will need the path in the next steps. To use OpenJFX 15 with JDK 15,
you will need to perform a series of steps every time you want to create a JavaFX project:<br>
<ol>
<li>Create a new JavaFX project like usual, by selecting New Project → JavaFX. Use the latest version of the JDK (15).</li><br>
<li>Add the JavaFX libraries to the project. Go to File → Project Structure → Libraries.
Click the + sign to add a library. Select Java. You will be asked to select the folder where the library has been installed.
Select the path of your OpenJFX installation. You should select the “bin” subfolder. If you installed it in the Java folder, it should be “C:\Program Files\Java\javafx-sdk-15\bin”. Click OK.
Optional: You may wish to change the name from “bin” to something more appropriate, like “javafx-sdk-15”. Click OK again to exit this screen.</li><br>
<li>Next, you will have to select custom VM options. Go to Run → Edit Configurations. Click the arrow icon in the field for VM options to enlarge the input box. In this input box, paste the following text:</li>
</ol>
</p>
<!-- Had to add a separate paragraph to make margin left work -->
<div>
--module-path "C:\Program Files\Java\javafx-sdk-15\lib" --add-modules=javafx.controls,javafx.fxml
</div>
<br>
<p>
Make sure paste the text exactly as-is, all spaces and quotes included.
The path to JavaFX should be changed to the correct one if you have not installed it in<br>
"C:\Program Files\Java\javafx-sdk-15\lib".
You should now be able to Build and Run your project.
<br>
<br>
Relevant links:<br>
<a href="https://www.oracle.com/java/technologies/javase-downloads.html" target="_blank">Download latest JDK (15)</a>
<br>
<a href="https://openjfx.io/" target="_blank">OpenJFX website</a>
</p>
</body>
</html>