Decompiled .class file in Android studio - java

I got problem during adding library into Android Studio project.
I add jar file to directory libs. I clicked Add as library and the problem is that when I try to run project, it fails.
The problem is decompiled .class file bytecode version 51.0 (Java 7).
Error in Android Monitor is NoClassDefFound.
What I got for now, is that I should have java files, but I have .class files.
Can anybody tell me how to solve this problem?

I solve my problem just using Java Decompiler and adding new java files to project.

Related

Source not found when open Java Imported Class on Eclipse Luna

I have some problem to open the class inside my project libraries on Eclipse Luna. For the beginning I have .war file of my web apps, I imported that .war files to Eclipse Luna and I could open index.jps files and other files under Web Content folder. But when I'm tried to open the engine class file I got Source not found. This is the screenshot of the errors.
I'm new in Java code and with Eclipse. What's wrong with that errors and how to resolve that problems ? Please anybody knows could help me. Thanks before.
WAR files don't usually contain the Java source code, just the compiled class files which is what you are seeing.
If you have the Java source elsewhere you can use the 'Attach Source...' button shown in that screenshot to tell Eclipse about it.

How to get app version from apk file using JAVA eclipse

Is there any way that I can get the app version from apk file
using JAVA eclipse?
thanks for your time!
You can extract the apk via 7zip/WinRAR and then open the folder with sublime and then look for version. You will get a hit if you are lucky.
The concrete way would be to decompile it and then do a search.

Eclipse: Java3D library cannot be read or is no valid zip file

I have a strange error: I want to use Java3D but Eclipse gives me following error about the library .so file
Archive for required library: 'libs/libj3dcore-ogl.so' in project 'MyTest' cannot be read or is not a valid ZIP file
I'm using Ubuntu 14 LTS 64bit so I've downloaded the amd64 version of Java3D 1.5.1:
http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-java-client-419417.html#java3d-1.5.1-oth-JPR
regards
You are not supposed to import .so files to eclipse as libraries. This is a native file, shared library to be exact. It needs to be linked at runtime using:
System.loadLibrary("j3dcore-ogl");
You need to find a .jar file, which you should put into eclipse as library instead of the .so file. Then you can either attach this file to your library, or link it during runtime yourself.

Opencv native location set up for java-eclipse linux based

I am trying to setup a java based opencv program to run on raspberry-pi.I installed opencv-2.4.8 on my raspberry-pi. I also installed eclipse to set up opencv.The problem is i am not able to link native libraries for my opencv-2.4.8 jar file in eclipse.
Eclipse is running fine with raspberry-pi and i am able to compile and run simple java programs.From where to link the native library for opencv2.4.8 jar file.
I checked my opencv folder and it is having the following structure.
MY OpenCV Folder
Opencv release folder
Found the following opencv .so files in usr/local/lib folder of my pi. Is this is what i should link to my native library. But there are many .so files also.
The output console with the error is as follows. sorry the screenshot skipped unsatisfied link error..
I had the same error which come up like this. I have an application that I have to run. I build and install opencv and try to run but I see that error like you. For solving this issue I replace old opencv_*jar with built one in opencv directory. You have to use jar file that you have just built.
..../opencv/build/bin/opencv-2410.jar
I thing old jar looks for different native path.
I had the same issue. I set my Native Lib Location to {OpenCV directory}/{Build directory}/lib and things worked fine.

Android: java.lang.NoClassDefFoundError after importing jar. Wrong jar?

After I've imported jar file into Android project and ran it, I get java.lang.NoClassDefFoundError At first I thought that I'm doing something wrong while importing it, but then I tryed to import jar that I've from some online class and it worked! So here is my question:
Is there any specific way of creating jar files for Android project?
I've to point out that first jar is created from Java class that I wrote some time ago. This jar works without problems in another java app. The jar was created using Eclipse Kepler.
Thanks for your help.
The solution shoved up to be pretty simple. Currently I'm using Java 1.7 to create my jar files, but Android accepts only jars that were created with Java 1.6. So the problem is caused probably by some incompatibility in bytecode and therefore you need to force compiler to use Java 1.6.
If you're using Eclipse, go to Project properties > Java compiler and select Compiler compliance level: 1.6 Save changes and rebuild your project. You're ready to export "working" jar :)

Categories