From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Carlo Tambuatco Newsgroups: gmane.emacs.help Subject: Any JDEE experts here? Need help compiling files. Date: Sat, 2 Jun 2018 11:22:08 -0700 (PDT) Message-ID: <602906c9-4540-4d22-ac90-a5ad1b285c56@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Trace: blaine.gmane.org 1527963800 1671 195.159.176.226 (2 Jun 2018 18:23:20 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 2 Jun 2018 18:23:20 +0000 (UTC) Injection-Date: Sat, 02 Jun 2018 18:22:08 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jun 02 20:23:16 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fPBBM-0000L0-Kj for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Jun 2018 20:23:16 +0200 Original-Received: from localhost ([::1]:60725 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fPBDT-0005Qm-N3 for geh-help-gnu-emacs@m.gmane.org; Sat, 02 Jun 2018 14:25:27 -0400 X-Received: by 2002:a37:c6d6:: with SMTP id s83-v6mr8029341qkl.45.1527963728714; Sat, 02 Jun 2018 11:22:08 -0700 (PDT) X-Received: by 2002:a0c:e70f:: with SMTP id d15-v6mr392947qvn.0.1527963728615; Sat, 02 Jun 2018 11:22:08 -0700 (PDT) Original-Path: usenet.stanford.edu!x25-v6no1704955qto.0!news-out.google.com!p41-v6ni1774qtp.1!nntp.google.com!x25-v6no1704953qto.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2600:1700:78d0:a570:b0f4:f00:b9d6:5e22; posting-account=kBs42AoAAAANLkgsfBE9l2x8G7L-UXT5 Original-NNTP-Posting-Host: 2600:1700:78d0:a570:b0f4:f00:b9d6:5e22 Original-Xref: usenet.stanford.edu gnu.emacs.help:222829 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116950 Archived-At: Here's my JDEE init file contents: (setq jdee-jdk-registry (quote ( ("1.8" . "/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home") ("9" . "/Library/Java/JavaVirtualMachines/jdk-9.0.4.jdk/Contents/Home") ("10" . "/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home") ) ) jdee-jdk `("1.8") );;end setq (setq jdee-server-dir "~/.emacs.d/jdee-server/") ;; Sets the compiler to use to compile java programs ;; was originally "javac server" (setq jdee-compiler '("javac")) I've got the jdk registry set up to use java 1.8 for compilation, and to use "javac" the local java compiler command instead of the default "javac server". When I compile a file from the command line using javac (not using emacs, using the shell outside of emacs), everything works great. The JVM runs the program without error. When I run c-c c-v c-c , which runs jdee-compile, (which is set to run the "javac" command per the options I set), it compiles the file, but when I run the compiled file I get the following error: Assuming I am compiling a file named HelloWorldSwing.java using jdee-compile: Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: HelloWorldSwing has been compiled by a more recent version of the Java Runtime (class file version 54.0), this version of the Java Runtime only recognizes class file versions up to 52.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:763) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:495) This error does not occur when I compile the HelloWorldSwing.java from the command line. I have no idea how to configure JDEE to properly compile the file using the same JVM as the command line. To be clear, emacs JDEE is configured to use jdk version 1.8, the same version jdk used at the command line.