satyagraha / gfm_viewer

An Eclipse plugin providing an accurate view of GitHub Flavored Markdown (.md) files
94 stars 27 forks source link

I'm getting this error when I'm trying to open the viewer. #73

Closed rodoabad closed 9 years ago

rodoabad commented 9 years ago

Plug-in code.satyagraha.gfm.viewer.plugin was unable to load class code.satyagraha.gfm.viewer.views.MarkdownViewDefault.

paulvi commented 9 years ago

What plugin version, OS, Java version etc ?

renelink commented 9 years ago

I had the same problem. I found a NoClassDefFoundError: java/lang/AutoCloseable in the stacktrace. Well, AutoCloseable is available since java 1.7 and I was running eclipse with 1.6. So I just started eclipse with Java 1.7 and the plugin works.

If you have the same issue change the -vm setting in your eclipse.ini

For example

-vm
C:\jdk1.7.0_21\bin\javaw.exe `
satyagraha commented 9 years ago

Now explicitly requires execution environment JavaSE-1.7. Fixed in 1.9.3.

paulvi commented 9 years ago

What version is recommended for Java 6 users ?

satyagraha commented 9 years ago

There is no version which works (properly) with Java 6. In theory, I could remove the use of the AutoCloseable interface, but I wouldn't test the code as I don't have Java 6 installed and don't intend to reinstall it. It went EOL in Februrary 2013. Users can have both JVM versions installed if they wish, and use the neat solution proposed above by @renelink.

Java 8 will soon be an essential install, e.g. for Scala 2.12, but I will stick with Java 7 for the plugin.

paulvi commented 9 years ago

Now explicitly requires execution environment JavaSE-1.7.

How? I know only p2 repository filter by OS

satyagraha commented 9 years ago

See the change at line 20 at https://github.com/satyagraha/gfm_viewer/commit/69d7188de6a460438fe6b8fa02e15ce2370489ad#diff-15

satyagraha commented 9 years ago

Eclipse (OSGi resource loader) will not load the plugin if it cannot provide the specified execution environment, and will give a reasonably comprehensible error message, i.e. not an exception with a traceback as before..

paulvi commented 9 years ago

OK, then no need for docs update