lovubuntu / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

The following files could not be located: jdk7.jar #188

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When I try to run the checker framework using the Eclipse plugin, I get the 
following error message:

javac output:
Exception in thread "main" java.lang.RuntimeException: The following files 
could not be located: jdk7.jar
    at checkers.util.CheckerMain.assertFilesExist(CheckerMain.java:428)
    at checkers.util.CheckerMain.<init>(CheckerMain.java:93)
    at checkers.util.CheckerMain.main(CheckerMain.java:37)

I don't remember using this file before. I'm not sure where I have to put the 
jdk7.jar file.

Original issue reported on code.google.com by reprogra...@gmail.com on 30 Dec 2012 at 12:10

GoogleCodeExporter commented 9 years ago

Original comment by wdi...@gmail.com on 30 Dec 2012 at 12:14

GoogleCodeExporter commented 9 years ago
I copied the file at checkers/binary/jdk7.jar to 
eclipse/checker-framework-eclipse-plugin/lib. This change resulted in a 
different error:

javac output:
Error occurred during initialization of VM
java/lang/UnsupportedClassVersionError: java/security/ProtectionDomain : 
Unsupported major.minor version 52.0

I built annotation-tools and the checker-framework using javac 1.7.0_10. Then, 
I ran Eclipse using java 1.7.0_10 to try the Eclipse plug-in.

I can use checkers/binary/javac to run a checker successfully.

It looks like the plug-in is complaining about a class file compiled using JDK8.

Original comment by reprogra...@gmail.com on 31 Dec 2012 at 8:12

GoogleCodeExporter commented 9 years ago
I assume I'm getting the unsupported class file version because I'm trying to 
run a checker on the class files generated using JDK8. Should I add jdk8.jar to 
the lib folder of the Eclipse plug-in then? I only have jdk7.jar perhaps 
because I built the checker framework using JDK7. Can I get jdk8.jar without 
switching over to JDK8?

Original comment by reprogra...@gmail.com on 31 Dec 2012 at 8:17

GoogleCodeExporter commented 9 years ago
At the moment it won't build a jdk8.jar because of a check I have put in the 
build file but I can update the build file and check a new copy in today that 
will allow you to use it with jdk8.  You would have to build the jar with jdk8 
which I have not done at the moment but was planning on testing in the medium 
term.

Original comment by Jonathan...@gmail.com on 31 Dec 2012 at 8:48

GoogleCodeExporter commented 9 years ago
Mohsen should not require a jdk8.jar, as he's building everything using Java 7.
The jdkX.jar files only contain API annotations.
I assume the "version 52" error is caused by not using the Checker Framework 
version of javac.

Original comment by wdi...@gmail.com on 31 Dec 2012 at 8:57

GoogleCodeExporter commented 9 years ago
I should also note that at the moment the checked in version still uses 
CommandLineJavacRunner.  Mohsen, is the version you are using the JavacRunner?

Original comment by Jonathan...@gmail.com on 31 Dec 2012 at 9:10

GoogleCodeExporter commented 9 years ago
The Eclipse plug-in is using CommandLineJavacRunner. I set 
CommandlineJavacRunner.VERBOSE to ture. I noticed that Eclipse plug-in runs 
java with the following argument:

-Xbootclasspath/p:/usr/lib/jvm/java-8-oracle/jre/lib/resources.jar:/usr/lib/jvm/
java-8-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-8-oracle/jre/lib/jsse.jar:/usr/li
b/jvm/java-8-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-8-oracle/jre/lib/charsets.
jar:/usr/lib/jvm/java-8-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-8-oracle/jre/li
b/ext/sunec.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/dnsns.jar:/usr/lib/jvm/ja
va-8-oracle/jre/lib/ext/cldrdata.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/zipf
s.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/localedata.jar:/usr/lib/jvm/java-8-
oracle/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/java-8-oracle/jre/lib/ext/su
npkcs11.jar

So, I changed the JRE system library of the example project from java-8-oracle 
to java-7-oracle. The example project is an Eclipse Java project on which I run 
the checkers using the Eclipse plug-in. As a result of this change, the Eclipse 
plug-in ran the checkers successfully and the command line argument changed to 
the following

-Xbootclasspath/p:/usr/lib/jvm/java-7-oracle/jre/lib/resources.jar:/usr/lib/jvm/
java-7-oracle/jre/lib/rt.jar:/usr/lib/jvm/java-7-oracle/jre/lib/jsse.jar:/usr/li
b/jvm/java-7-oracle/jre/lib/jce.jar:/usr/lib/jvm/java-7-oracle/jre/lib/charsets.
jar:/usr/lib/jvm/java-7-oracle/jre/lib/jfr.jar:/usr/lib/jvm/java-7-oracle/jre/li
b/ext/sunec.jar:/usr/lib/jvm/java-7-oracle/jre/lib/ext/dnsns.jar:/usr/lib/jvm/ja
va-7-oracle/jre/lib/ext/zipfs.jar:/usr/lib/jvm/java-7-oracle/jre/lib/ext/localed
ata.jar:/usr/lib/jvm/java-7-oracle/jre/lib/ext/sunjce_provider.jar:/usr/lib/jvm/
java-7-oracle/jre/lib/ext/sunpkcs11.jar

Original comment by reprogra...@gmail.com on 31 Dec 2012 at 9:24

GoogleCodeExporter commented 9 years ago
Thanks for tracking that down.  In the future there will be a jdk8.  You can 
also use a different JDK to run ONLY the Checker Framework (see 
Preferences->Checker Framework-> "Java Home Directory"  but in general I think 
people would want the version that Eclipse should be the version used to check 
the code.

Original comment by Jonathan...@gmail.com on 31 Dec 2012 at 9:33

GoogleCodeExporter commented 9 years ago
I restored my example project to use java-8-oracle and set Preferences -> 
Checker Framework -> "Java Home Directory" to /usr/lib/jvm/java-7-oracle. But, 
the Eclipse plug-in still uses java-8-oracle for -Xbootclasspath.

Original comment by reprogra...@gmail.com on 31 Dec 2012 at 10:30

GoogleCodeExporter commented 9 years ago

Original comment by michael.ernst@gmail.com on 29 Jan 2013 at 6:29