I've googled ProGuard for eclipse and all I can find is the Android version. I found one that looked like it would work but I found out it was out dated and their website was not even online anymore.
Anyone know where I can get eclipse to be able to export configurations so I can obfuscate my Jar files using ProGuard? This is all in Java by the way.
1) Add next line of code to your project.properties file in project folder:
proguard.config=proguard.cfg
2) Create proguard.cfg file in project folder with your proguard configuration
Here you can find example of proguard configuration for Android application Proguard manual page
3) Compile your application using Ant Building and Running from the Command Line
It is bundled with Pulsar.
It shuld be as a plugin, but it has broken link now.
Related
I checked this question and many other posts to help me resolve my issue, but nothing worked.
I trying to open an existing Java Project from Eclipse in vscode. The project was opened successfully in Eclipse 2021-06 and I fixed the referenced libraries by selecting the JAR libraries under lib/ folder and right-click - configure build batch - add select add to build path. Then the file .classpath was updated automatically. Then I had to download JDK 11 (needed for vscode) and JDK 1.8 needed for the Java project. I managed to work with eclipse to set the JDK correctly and all worked fine. I was able to compile the project, export the result JAR and deploy and all worked well.
I am having trouble to open this project in vscode using Open Java Project option. I am facing issues adding referenced libraries this Java project as it is a managed project (since it was created in Eclipse). When I try to add the libraries using vscode UI, I am getting mixed results and sometimes it is not working and the build fails. I was surprised as in some instances, things just work, and then they don't.
I tried to update .classpath file in vscode and still same issues. When I try to add the libraries from Referenced Libraries (Read Only) under JAVA PROJECTS tree in vscode by clicking +, it has no effect. This step will modify the file settings.json under .vscode folder by adding the relevant values to the property "java.project.referencedLibraries".
I am confused about how to configure the referenced libraries for Java projects in vscode. Following is a summary of questions:
How to add a library using a relative path to a Java Project based on the project root folder?
What is the difference between adding a library using the .classpath file and by modifying settings.json file? Which one will win?
How to add a folder with all JAR files to be as the referenced library to the Java Project? This is to avoid adding one file at a time.
Why the .classpath and .project files are not showing in vscode explorer view? It will only show when you open the file in vscode from the Windows File Explorer.
I found command Configure Classpath but it is read-only, which I think it is the same as the .classpath file. Is there a way to change it from vscode UI?
When I remove .classpath file or when I removed the classpathentry lines from the .classpath file, the node 'Referenced Libraries (Read Only)' under JAVA PROJECTS in vscode view was removed. Why?
See the snapshots below for more details.
I appreciate your help.
Basically speaking, java extension looks for jars from Referenced Libraries.
Here're my answers to your questions:
Right click the jar and choose copy relative path then add it to settings, click the refresh button then the added jar should be displayed under the option Referenced Libraries:
The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. When it comes to add jars, settings java.project.referencedLibraries wins.
No way to select
jar folders but you can use keyboard shortcuts to select all jars then add them.
There's a setting called "java.configuration.checkProjectSettingsExclusions", and it's true by default, so .project and .classpath won't be shown in VS Code.
The command Java: Configure Classpath works on my machine, which can customize current project.
My guess is when you open a new project, vscode popped up a window and ask you if trust it, and you chose Not, then project is read-only. Trusting the workspace then try the command Java: Configure Classpath again, it should be writeable.
The answer by #Molly Want-MSFT helped me a lot. Following is what I did to resolve the problem for good. I applied the steps below many time to verify they will work every time.
Steps to open a Java Project in both Eclipse and vscode:
Download the JDK needed for vscode, Eclipse and your Java Project.
Import the project in Eclipse and setup the JDK for the workspace and the project. Also, make sure to setup the compile level to match the JDK.
Set up the Project JDK to match the default of the workspace.
Build the project (Project-Cleanup) and Export the JAR to make sure all is OK.
Now open the project in vscode.
Setup java.home in Settings, in user and workspace sections. This must be JDK-11 or higher to allow vscode to function properly for Java Projects.
Add references to the installed JDKs in User's settings.json under "java.configuration.runtimes" section.
Restart vscode and take the option Configure Java Runtime from JAVA PROJECTS view. Make sure that the JDK of the Java Project is detected and working correctly.
You may have to open one of the Java Source Code Files. Wait a bit until it will settle down. Check the Java Build Status progress by clicking the spinning icon in the bottom right. This icon is for Language Server and it will turn into an icon that looks like thumbs-up when build/compile is done.
Close and open Configure Java Runtime to verify that the JDK was detected by vscode.
Ensure that both JRE System Libraries and Referenced Libraries under JAVA PROJECTS view are visible without any errors. Check the Problems view and try to resolve all errors.
The Referenced Libraries should be Read Only because this project was setup in Eclipse. You can delete the .classpath and .project files and open the project again in vscode, and try to fix the problems by adding libraries using the + button. When such files are deleted, the project will become Unmanaged. Later, you can restore such files.
When the project is unmanaged, you use Configure Java Runtime from JAVA PROJECTS view and you can check the project type. You can change the JDK to one of the installed ones as per the section "java.configuration.runtimes" in the user's setting.json.
If the the Referenced Libraries is read-only, it has no effect even if you can add libraries into settings.json, but the .classpath file will win.
From JAVA PROJECTS view, you can use the option Build Workspace and Clean Workspace to troubleshoot and try to resolve errors.
Finally, you can Export JAR from the option on JAVA PROJECTS view. This option is not clear and it looks like and arrow pointing to the right |-->.
I hope this helps, and if you have any question, please post a comment and I will try to answer back when possible.
I just change the path strings of the jars in the .classpath file and it works for me.
I wanted to test the .java Plugin class which will help in the exposure of the methods that are available in the integrated .aar SDK. I have created the cordova project and integrated the .aar SDK file. I added the plugin class to src directory. I referred to http://moduscreate.com/plugin-authoring-cordova-6-ios-android/ for the changes that has to be done in the .js and .html files. I added the feature in config.xml (app's res directory). But everytime I run the command cordova build android the config.xml file gets reset. But If I run the app using Android studio it works fine. Why is it so?
If you build through Command line, every time it will replace your platform config.xml file with config.xml file(exist in your project folder). If you want to build an app with your custom plugin then you should add a plugin through cli(it wont accept manual installation).
Please follow this link for more details.
Edit
Just saw the other answer and it is not much different from mine. Should have checked before I answered.
Original
The config.xml in platform folders get replaced with the config.xml in the projects root folder everytime you build. Either change this one or add plugins through the command line and Cordova will edit it for you.
I want to use the included tile packager from osmdroid's solution to use maps offline since Mobile Atlas Creator didn't work for me (I want 16x zoom levels which is not possible using this tool).
The instructions say that should run a .jar file using a command line, but there are no .jar files in the package and there are only source code files which when I run with netbeans IDE, gives me an error about unresolved dependency issues.
Anyone have any suggestions on how I can do this?
The answer given here didn't work for me as the .jar file always gave me a manifest (main class) error. So what I ended up doing was:
Download the project from github
run a 'gradle build' in the top folder (you can comment out the included libraries in the settings.gradle file if there is any problem with the Android SDK and you only need to use the tile packager)
run a 'gradle run' in the OSMMapTilePackager folder
by now gradle should have generated the following folder: OSMMapTilePackager/build/distributions/ and inside that folder you should have a zip file called something like OSMMapTilePackager-5.6-SNAPSHOT.zip. Unzip it
Go to the bin folder and run ./OSMMapTilePackager -gui
A window should have opened asking you for the parameters to download the tiles.
Got the procedure from this issue discussion.
Hope this helps anyone.
Just call gradle compileJava in OSMMapTilePackager directory. The jar should be in the tagret directory.
The current Jsoup release 1.7.3 has a known issue that it is using String.isEmpty() which is not supported by Android API Level 8.
I can see crash report of my app so I tried to fix this by change the source code of Jsoup and build my own jsoup.fix.jar. I test this jar with JAVA application and it worked fine on my PC.
I noticed that when I remove the original jsoup-1.7.3.jar from my project, there is errors complaining cannot find jsoup stuff, and the those errors are gone after I add the jsoup.fix.jar which seems to be good. I also check the JAVA build path and the exporting configurations, jsoup.fix.jar are all set as it should.
However, when I tried to run the APP on my Android devices, the APP crashed and saying it cannot find org.jsoup.Jsoup.
I checked the jsoup.fix.jar, opened it with JD-GUI and find the classes are all there, but I used my dex2jar to convert the classes.dex in my /bin directory, I cannot see nay org.jsoup stuff.
Just replace my jar file with the original jar will not have the same issue reproduced.
I also noticed that in my jar, the MANIFEST.MF file only have one line of content, but in the released jsoup-1.7.3.jar, the MANIFEST.MF contains a lot of content.
I am confused now, questions:
Am I doing wrong when build my own jar?
Why the APK still cannot include the jsoup pacakage even I configured it to do so?
Finally I found the reason might be the jar is exported from a JAVA project.
I have tried to create an Android project and copy the source files into it and then export another jar file, and it works!
Could anybody explain why?
I just added a plugin to my Eclipse RCP project and am getting the error: Unable to find feature.xml in directory
What does this mean?
You have probably installed the plugin incorrectly. The feature needs to be unpacked in order for it to work. What happens now is that Eclipse is looking for a feature.xml file but only finding the jar file.
Check your .../eclipse/features catalaog and you will find jar'd features. Using a program and unzipping the jar file should solve the problem.
If you install using an update site the feature will be unpacked automatically.
Discussion about this fault here:
http://www.eclipsezone.com/eclipse/forums/t92012.html
The problem occurs if you install the plugin+feature not via update site.
check configuration/org.eclipse.equinox.simpleconfigurator/bundles.info to see whether your plugins has registered here.