How to recover deleted java files on a mac? - java

Using Eclipse I accidentally deleted the wrong folder on my file system and lost hundreds of java files on my mac yesterday.
I am using a second mac to connect to my mac via firewire.
My mac appears as an external disk on the second mac.
I am running data recovery programs on the second mac to ensure that none of the deleted files are overwritten by writes to the file system on my mac.
I've tried a couple data recovery programs (Disk Drill, Data Rescue 3), but they don't seem to be able to recognize .java files.
Has anyone had a good experience recovering deleted .java files on a mac?

Eclipse usually keeps internal history. You should be able to restore the files using Eclipse itself, if the files were deleted in Eclipse: In context menu of you project you should see "Restore from Local History.." item.
On the other hand I would recommend to always use SCM tools (such as Git, Mercural etc). This way you will never lose your code. Practially every SCM tool this days has a very good Eclipse plugin.

Related

How to assure windows that my app is safe to run?

For my college project, I created a MapGenerator to create maps for the project. It is a group project, so I converted my .java files to .exe using Launch4J.
I then shared it to my friends using Google Drive. But then, while downloading, my friends said that Google said that the download is potentially dangerous. They just selected "Keep" and continued the download. The problem came when Windows doesn't let them to run that app at all. We know it's a safe application and does nothing wrong other than creating .csv files.
So, is there any way to assure Windows that this is a safe application and allow it to run the application?
PS: I use IntelliJ without gradle or maven, just IntelliJ (if this is a necessary info)
You can select the exe you want to run --> Click properties --> Under the general tab beside the security option --> check the unblock. Then it should definitely run
To have your exe like other software , you have to get your exe signed but I don't know how to do it. The solution I gave is a duct tape glue solution and I thought it would help.
You can check this link for more info:-
Signing a Windows EXE file

Converted jar to exe file but not working after installation

I converted my first java swing app to exe using advanced installer and inno setup(Tried both no result).
Considering Inno Setup : on double clicking nothing happens
Considering : Advanced Installer -> On executing my app open but after providing credentials nothing happens so i assume it may be database issue.
About my app: It is a small swing based saving and retrieving data of employees payment.
Database used : MySQL
I had imported database schema to client PC and made .exe file of app so that after installing it can access data.
The Jar files runs successfully and able to access the data as well.
So i think while creating .exe is their anything to be done about database .
Please suggest me where i am mistaken .
Download Launcher4J Software and build Exe out of jar file!
This is the Best and all fixes will done!
I think this is more like an application issue rather than an installer generated one. Have you tried to debug your application code after it is deployed using a setup package?
Also, in Advanced Installer, under Java Products view of your project there is a Virtual Machine section where you can choose to save the output and error stream in a log file. The log file will be created at app runtime just beside the EXE launcher. Maybe this will help you to catch some errors logged.

How to I restore my file association so that .jar files are opened with java instead of unarchiver (on Mac)?

I have the latest versions of both JDK and JRE installed on my Mac.
I downloaded unarchiver recently, and accidentally changed the default program to open .jar files to it, so now when I double-click on a .jar file it automatically opens in unarchiver.
I've been looking everywhere but I can't find any useful information on a simple way to just change the file association back. Java doesn't show up as an 'application,' so I can't just click on select a different application and chose Java as the application to open the .jar with.
Please help

IntelliJ IDEA one project - two operating systems

So I am creating a java project with a friend of mine, he is using windows and I am using ubuntu. I didn't give it much thought because java is cross-platform but I am having trouble opening the project I cloned from our git repo that he created in windows. The file browser recognizes the project but when I open the folder with the intelliJ icon it only opens the iml file and the class files, but not the folders and I don't have a hierarchy on the left tab. So I am wondering if it is a problem with our OS or if its some problem with intelliJ.
How did you set the project up with Git? You should only be pushing your source files, and all others (such as the .iml) should be ignored. That way, any person using any OS or any IDE can easily set it up on their own.
Try removing all your files from git besides the source files. Now, if you clone it and set it up with IntelliJ, any IntelliJ specific files should stay locally, and only source files will be pushed.

Trying to remotely compile, using the command line, a Java program with multiple dependencies that I can currently only compile locally in Eclipse

Some weeks ago at work I took over a Java-based back-end web application written using Eclipse. The nature of the application is that it cannot be adequately tested locally, and instead changes need to be tested on our testing network (which involves pushing the changes to an AWS Micro server that we connect to via SSH).
Until now, I pushed changes in the same way as my predecessor: compile the program using Eclipse's Export to Runnable JAR File option, then scp the jar to the remote server and run it. However, this process has a huge problem. While compilation takes only seconds, the jar is well over 30MB, and pushing the entire thing from the office to the remote server over our fairly ordinary internet connection takes well over 10 minutes. If I'm having a particularly bad day and, say, introduce several minor bugs to the code and then discover them one by one, I can easily end up losing an hour or more in total twiddling my thumbs while pushing the whole jar over and over for a series of one-line changes.
Clearly, a saner solution than scping the entire jar for every change would be to simply remotely pull only the changed .java files from source control, and then compile the new version entirely remotely. However, I'm quite new to Java (and indeed programming generally) and all my Java work has been on existing Eclipse projects that I've taken over partway through development. As such, I know very little about compiling Java, and I have found the tutorials about this online are mostly either opaque or completely fail to address the question of how to compile code that uses external libraries.
I will relate here what information about the project's dependencies I can find from Eclipse, and my questions are these: what do I need to copy to the remote server, and where do I need to put it, to be able to compile remotely? What tools, if any, do I need to install on the remote server to be able to compile there? And once I've got everything set up, what do I actually type at the command line to get it to compile?
Anyway, here's what I know about the dependencies and directory structure (I've anonymised our application name by calling it “bunnies”):
The application source code is located in bunnies/src
We compile to bunnies/bin/main.jar
bunnies/dependencies contains three jars of external libraries that we use.
Right-clicking on the project in Eclipse, going to the Java Build Path section, and selecting the Libraries tab, I see
the three libraries above
(appearing in the form, e.g. “json-simple-1.1.1.jar - /home/mark/workspace/bunnies/dependencies”)
a fourth jar file in another location
(“M2_REPO/com/google/guava/guava/r09/guava-r09.jar - /home/mark/.m2/repository/com/google/guava/guava/r09/guava-r09.jar”)
JRE System Library [java-6-openjdk-i386]
But there's more! We also use two libraries, mahout-core and mahout-integration, that are included as separate projects in the same workspace rather than as jar files in the dependencies folder. They appear by name on the Projects tab of the Java Build Path section of the bunnies project, and are located at /home/mark/workspace/mahout-core and /home/mark/workspace/mahout-integration respectively.
Since I am not a Java whiz, perhaps there are also some other hidden dependencies I'm missing, that don't appear in any of the places I've looked so far?
If anyone can walk me through the steps of compiling this huge mess from the command line, without needing to use the Export option in Eclipse, so that I can ultimately compile it all remotely, I would be highly appreciative.
Look into Apache Ant. It's a build-suite for Java, sort of like an XML based Makefile system.
I have a Java system running on a remote server. I have a directory structure separated into /src and /build. I then just scp the .java files from my local machine to the /src folder and build using ant.

Categories

Resources