Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #38935 > unrolled thread
| Started by | Knute Johnson <groups@585ranch.com> |
|---|---|
| First post | 2019-04-23 21:54 -0500 |
| Last post | 2019-04-23 21:54 -0500 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.java.programmer
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Invoke java with JavaFX Knute Johnson <groups@585ranch.com> - 2019-04-23 21:54 -0500
| From | Knute Johnson <groups@585ranch.com> |
|---|---|
| Date | 2019-04-23 21:54 -0500 |
| Subject | Re: Invoke java with JavaFX |
| Message-ID | <q9oj5t$6o7$1@dont-email.me> |
On 4/23/2019 7:35 PM, Stefan Ram wrote: > Old programmers might remember that in early JDKs one had to write > > javac Main.java > java Main > > while today we can write just > > java Main.java > > to execute the program. > > But is this also possible with JavaFX? > > Today, I use /two/ commands to start a JavaFX application > from »Main.java«: First, > > ..\jdk-11.0.1\bin\javac -p "...\javafx-sdk-11.0.1\lib" > --module-path "...\javafx-sdk-11.0.1\lib" > --add-modules=javafx.controls,javafx.swing Main.java > > and then, > > ..\jdk-11.0.1\bin\java -p "...\javafx-sdk-11.0.1\lib;." > --module-path "...\javafx-sdk-11.0.1\lib" > --add-modules=javafx.controls,javafx.swing Main > > (each a single line, wrapped here for the post; > »...« indicates initial path fragments omitted in this post) > > I tried to merge the lines into one, trying both > > ..\jdk-11.0.1\bin\java -p "...\javafx-sdk-11.0.1\lib;." > --module-path "...\javafx-sdk-11.0.1\lib" > --add-modules=javafx.controls,javafx.swing Main.java > > with »;.« and > > ..\jdk-11.0.1\bin\java -p "...\javafx-sdk-11.0.1\lib" > --module-path "...\javafx-sdk-11.0.1\lib" > --add-modules=javafx.controls,javafx.swing Main.java > > without »;.«. But both threw strange error messages at me. > > So, is the simplification to a single command only > possible for simple cases? > > Or did I miss anything about how to merge these two > lines properly? > > If you include the . in the path when running java -cp . Main.java and there is a Main.class in the class path it won't work. You get this error: error: class found on application class path: YourApp. I also don't think you need the -cp "...\javafx-sdk-11.0.1\lib" part either. knute...
Back to top | Article view | comp.lang.java.programmer
csiph-web