Need a help.
Iam trying to edit the source of an apk.
I unpacked that apk using apktool then convert that "classes.dex" file into ".jar" using dex2jar and then open that .jar file in jd-gui to save all the sources now all the sources have saved in different different folders containing ".java" files.
Now my problem is that when ever I am trying to compile a single .java file using javac it's shows error: the specified module is not found. But that module is there in that same folder. I also tried eclipse but it shows that same error.
Is there any way to compile all that folders containing .java file back to "classes.dex" using one compilation command. Or is there any tools for compilation?
In the folder where all the .java files are that you want compiled, run javac *.java then java *.
Related
I'am working on a python script , which involves few steps of creating a jar file.
However when i run the following lines of code i get the jar file created, having .java files and not .class files .
subprocess.call(['jar', 'cvf', 'process.jar','C:/my data/temp/process/src'])
Is there any way to get the jar file created with .class files similar to Export generated class files and resources checkbox in export jar dialog in eclipse .
Thanks
Make sure where is your *.class files located, I assume it is in bin directory or something:
subprocess.call(['jar', 'cvf', 'process.jar','C:/my data/temp/process/bin'])
I'm trying to cmd line compile a .java selenium test script into a class file that I can run from the command line.
All of my selenium jar files and all other supporting jar and lib files are in C:\JarFiles
My CLASSPATH is set to C:\WDJarFiles*
I am working at the command line here: C:\EclipseIDEworkspace\MC3\src\Tasks
My .class files are located here C:\EclipseIDEworkspace\MC3\bin\Tasks and I'd like to be able to update them at that location.
My folder structure was set up by using Eclipse IDE so I'd like to keep the existing folder structure but now I want to be able to compile my .java files from the command line and update the .class files.
So, when I run javac like this:
javac Edit.java
It compiles OK and the .class file gets created in the same folder where I am running the javac command -- but -- I also get a huge number of other .class files in this same directory! These look like supporting class files.
I'm not sure what my cmd line javac syntax should be to:
Compile my .java file so its .class file gets updated in the C:\EclipseIDEworkspace\MC3\bin\Tasks folder.
I don't get all those other .class files created in my working folder C:\EclipseIDEworkspace\MC3\src\Tasks
Thanks for any help...
You should try the '-d' option to specify an output directory:
javac Edit.java -d ..\..\bin\Tasks
About the multiple other .class files, you probably have many nested classes into your Edit.java file?
I get jar file with library from NetBeans and i cant convert it to apk.
Converter ask JAD and JAR files.
I have one main jar and two more in lib folder.
You can't convert .jar file to .apk!
inside a jar file we have .class files but inside the .apk we have .dex files which .dex files can convert to .class and after that .java.
so you can see a jar file is one step behind the .apk file
Change the project(module) settings from library to application.
I started off with a .jar file that I unzipped. I need to change a few lines of code in just ONE of the classes contained in the contents of that jar file. I went about this as follows:
1) opened the class in Java Decompiler to view the source.
2) copied source to a new text file and saved with ".java" extension.
3) in command line I went to jdk folder and executed javac Classname.java to recompile.
However this class code imports some dependencies so the recompile failed. I have the dependencies, they were part of the original jar file contents but they are all compiled .class files and spread across several folders...
Is it possible to re-compile this class successfully? Is there command line code to include dependencies?
Yes, use the -classpath option.
javac -classpath original.jar Modified.java
Then, you can remove the old class from the jar file and insert the new one. There isn't a simple way to do this via command line, so I recommend an archive application such as WinRAR or 7-zip.
I am trying to compile a Java source file on command prompt with the following command
C:\temp\test>javac -cp ".\*;" *.java
but the class does not get compiles, I have errors of type files not found, or could not find resource.
Even though the jars are present in the same directory as the Java files.
C:\temp\test>javac -cp ".;*.jar" *.java
See http://java.sun.com/javase/6/docs/technotes/tools/windows/classpath.html
It is easy to forget that a .jar file is a compressed file system structure, not a .class file. When you specify a directory in -classpath, all .class files in that directory are available to the loader. Specifying a .jar file is analogous to specifying a directory, but in addition to the .class files in the .jar file's root directory, it also makes available .class files in the packages compressed into the .jar structure. Remember that the package structure mirrors a directory structure.