Google Developer Tools Java FATAL ERROR - java

Thanks in advance for your help.
I am new to the Google developer tools and I have been messing around trying to figure out how to get one of their features to work.
This one most specifically:
https://developers.google.com/appengine/docs/java/tools/eclipse#Running_the_Project
So this is how far I've gotten.
I updated my Java package to 1.7. I installed the Google plug in for eclipse.,
I created a new project named "Guestbook", made sure the boxes were checked, run->DebugAs-> WebApplication, and then I get this huge error:
Exception in thread "main" FATAL ERROR in native method: processing of
-javaagent failed java.lang.UnsupportedClassVersionError: com/google/appengine/tools/development/agent/AppEngineDevAgent :
Unsupported major.minor version 51.0 at
java.lang.ClassLoader.defineClass1(Native Method) at
java.lang.ClassLoader.defineClassCond(ClassLoader.java:637) at
java.lang.ClassLoader.defineClass(ClassLoader.java:621) at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283) at
java.net.URLClassLoader.access$000(URLClassLoader.java:58) at
java.net.URLClassLoader$1.run(URLClassLoader.java:197) at
java.security.AccessController.doPrivileged(Native Method) at
java.net.URLClassLoader.findClass(URLClassLoader.java:190) at
java.lang.ClassLoader.loadClass(ClassLoader.java:306) at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at
java.lang.ClassLoader.loadClass(ClassLoader.java:247) at
sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:280)
at
sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl.java:338)
I don't know what all this means.
I am still fairly new to java, so any help would be excellent.
Hope all is well

Related

Trying to do OCR with on mac using Tesseract OCR to Page (TPT) and Page Viewer (PVT) and Aletheia software

I'm trying to use Aletheia and tesseract-orc with some images in mac. But I faced many problems:
I can't make Aletheia work with wine, it just doesn't open
I followed the instruction of the question Stackoverflow question but I've got this result regarding the use of Tesseract OCR to Page (TPT) and Page Viewer (PVT):
$ java -XstartOnFirstThread -jar JPageViewer.jar "$dl/Downloads/paper-3-tool.xml" "$dl/Downloads/paper-3.tif"
2015-12-08 18:53:34.327 java[33741:1234051] *** WARNING: Method userSpaceScaleFactor in class NSWindow is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
2015-12-08 18:53:34.336 java[33741:1234051] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/primaresearch/dla/page/layout/physical/shared/ContentType : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.primaresearch.page.viewer.ui.MainWindow.init(MainWindow.java:51)
at org.primaresearch.page.viewer.PageViewer.<init>(PageViewer.java:79)
at org.primaresearch.page.viewer.PageViewer.main(PageViewer.java:50)
Any suggestions?? Sorry, If I put the question in the wrong place before. Thanks!!

How to convert jar file to DMG from windows Operating System

I had Developed Java Application in Windows 7.
And I had made JAR file of that application.
Now I want to convert that File into DMG format which is compatible for MAC Operating System.
Can any one Suggest me steps please?
I tried into terminal But got this errors.
DEVs-MacBook-Proist idev$ java -jar Soul_Spotter.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: idev/soulspotter/Login : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
The below link explains the steps. I've also copied the answer which worked for me.
Copied from convert java app to mac installer...dmg
Use "Jar Bundler" in the XCode download from Apple Developer
Connection.
http://developer.apple.com/technology/xcode.html
You will need to register for a free account.
Steps: http://www.centerkey.com/mac/java/

How to disable TrueZIP key manager services?

I want to use TrueZIP 7.7 library in a server to uncompress user-uploaded archives. I don't plan to work with encrypted archives, and especially, since this is a server, I don't need a Swing popup to ask for a key. Yet when I created some simple test for unzipping a file, it failed with this error:
java.util.ServiceConfigurationError: de.schlichtherle.truezip.key.spi.KeyManagerService: Provider de.schlichtherle.truezip.fs.archive.zip.raes.PromptingKeyManagerService could not be instantiated: java.lang.NoClassDefFoundError: de/schlichtherle/truezip/swing/EnhancedPanel
at java.util.ServiceLoader.fail(ServiceLoader.java:207)
at java.util.ServiceLoader.access$100(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353)
at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
at de.schlichtherle.truezip.key.sl.KeyManagerLocator$Boot.<clinit>(KeyManagerLocator.java:60)
at de.schlichtherle.truezip.key.sl.KeyManagerLocator.get(KeyManagerLocator.java:41)
at de.schlichtherle.truezip.key.AbstractKeyManagerProvider.get(AbstractKeyManagerProvider.java:22)
at de.schlichtherle.truezip.fs.archive.zip.KeyController.getKeyManager(KeyController.java:62)
at de.schlichtherle.truezip.fs.archive.zip.KeyController.sync(KeyController.java:129)
at de.schlichtherle.truezip.fs.FsDecoratingController.sync(FsDecoratingController.java:131)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.sync(FsFalsePositiveArchiveController.java:480)
at de.schlichtherle.truezip.fs.FsManager.sync(FsManager.java:105)
at de.schlichtherle.truezip.fs.FsDefaultManager.sync(FsDefaultManager.java:190)
at de.schlichtherle.truezip.fs.FsSyncShutdownHook$Hook.run(FsSyncShutdownHook.java:93)
Caused by: java.lang.NoClassDefFoundError: de/schlichtherle/truezip/swing/EnhancedPanel
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at de.schlichtherle.truezip.fs.archive.zip.raes.PromptingKeyManagerService.<init>(PromptingKeyManagerService.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
... 11 more
Caused by: java.lang.ClassNotFoundException: de.schlichtherle.truezip.swing.EnhancedPanel
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 31 more
Is it possible to disable TrueZIP key management completely, or at least make sure it doesn't require any Swing components just to extract a ZIP file?
With TrueZIP, you have to satisfy the dependency of the TrueZIP Driver ZIP on TrueZIP Swing, or otherwise you won't get rid of this exception. As long as your app doesn't encounter WinZip AES encrypted entries, the key manager popup does not appear. You can also implement your own key management by following this article: http://truezip.java.net/truezip-driver/truezip-driver-zip/key-management.html (but you still need to satisfy this dependency).
Alternatively, you could migrate to TrueVFS. TrueVFS has an even more modular architecture where you could simply add the TrueCommons KeyManager Disable module on your class path to get the same effect.

Java NoClassDefFoundError in Command Line

I'm getting the NoClassDefError when I try to run my program from the command line. It works fine in Netbeans, and javac compiles correctly.
I have a class called DistributedSystem which so far is only supposed to print "hello.".
The directory is src/distributedsystem/ which contains DistributedSystem.java, and DistributedSystem.class after the compile.
If I'm inside src/distributedsystem/ and run
java DistributedSystem
then I get
Exception in thread "main" java.lang.NoClassDefFoundError: DistributedSystem (wrong name: distributedsystem/DistributedSystem)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
I also get the exact same error if I'm inside src/distributedsystem/ and run
java -cp . DistributedSystem
which is what I thought would fix the problem. I have also tried making sure classpath isn't set somewhere else, even though -cp should overwrite it. Anyone have any ideas what could be wrong?
Go to folder src then compile from there and then run
The classpath should point to the base directory. It looks as if you are attempting to run class DistributedSystem in package distributedsystem, but your classpath is set to project/bin/distributedsystem instead of project/bin.

Parse JSON string in Java

I'm trying to parse a JSON string in Java but I cant figure out how!
I'm using lib-JSON right now:
import net.sf.json.*;
.
String jsonStr = "{'string':'JSON', 'integer': 1, 'double': 2.0, 'boolean': true}";
JSONObject jsonObj = (JSONObject) JSONSerializer.toJSON(jsonStr); // this line crashes
I get no compilation errors but when i run the program it says:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at ircbot.plugins.SiteTitle.<init>(SiteTitle.java:28)
at ircbot.Main.main(Main.java:10)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 14 more
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
It sounds like I'm missing some dependencies, but I don't know how to find out if or which!
Thanks in advance!
It seems you have not imported need jar file for class "org.apache.commons.lang.exception.NestableRuntimeException"
There are many classes that we use in our Java program and which don't come with Java. So we need to put Suitable Jar file for them.
I recomend grepcode
Just enter the class name and you get a list of the known versions of jars
Example: here
You are missing jar file. No jar file in your class path.
see this Reading JSON file error
org/apache/commons/lang -> http://commons.apache.org/lang/
Basically, use Google and get the respective jar.
Your JSON String also not valid, This the valid JSON,
{"string": "JSON","integer": "1","double": "2.0","boolean": "true" }
These are the dependencies -
jakarta commons-lang 2.5
jakarta commons-beanutils 1.8.0
jakarta commons-collections 3.2.1
jakarta commons-logging 1.1.1
ezmorph 1.0.6
are you sure you added all of them in your classpath.

Categories