Path: csiph.com!aioe.org!.POSTED!not-for-mail From: =?UTF-8?Q?Arne_Vajh=c3=b8j?= Newsgroups: comp.lang.java.programmer Subject: Re: Problem compiling with 9 for 8 Date: Mon, 2 Oct 2017 16:10:15 -0400 Organization: Aioe.org NNTP Server Lines: 44 Message-ID: References: NNTP-Posting-Host: PBuS014lhzVyHjLbXmo/ZQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.java.programmer:37521 On 10/2/2017 3:49 PM, Knute Johnson wrote: > On 10/2/2017 13:25, Arne Vajhøj wrote: >> On 10/2/2017 11:51 AM, Knute Johnson wrote: >>> I want to compile this program with the Java 9 compiler but with but >>> with the --release 8 option so that it will run on a Java 8 runtime. >>> The --add-modules option is not available if the --release options is >>> specified.  Anybody know what the solution is?  Am I going at this >>> the wrong way? >>> >>> C:\Users\Knute Johnson>javac --release 8 -Xlint:unchecked -cp >>> .;com/knutejohnson >>> /rosen/javax.mail.jar com/knutejohnson/rosen/PHD2Alarms.java >>> .\com\knutejohnson\rosen\AlarmDialog2.java:9: error: package >>> javafx.scene.media >>> does not exist >>> import javafx.scene.media.*; >>> ^ >>> .\com\knutejohnson\rosen\AlarmDialog2.java:60: error: cannot find symbol >>>          AudioClip clip = null; >>>          ^ >>>    symbol:   class AudioClip >>>    location: class AlarmDialog2 >> >> Have you tried putting Java 8 jfxrt.jar explicit in classpath? > > No but that file is not included in Java 9.  It compiles fine if I don't > have the --release 8 option and it compiled fine under Java 8. Yes. But does it work? It is my understanding that: javac --release 8 ... is really a short version of: javac -source 1.8 -target 1.8 -Xbootclasspath:pathtojava8jar ... And if that is correct then it still need the old jar files to build against. And maybe it just don't find jfxrt.jar automatically. Arne