Changing java security file in windows - java

I am trying to edit the java.security file in windows. When I add an entry to it and try to save, it says 'Access Denied'. How do I change the permissions to this file.
I have also tried by making notepad to Run as administrator but it didn't work.
Please help.

Try this and say if it works. It worked for me while opening hosts file.
http://www.labnol.org/software/edit-hosts-files-as-administrator/13673/
edit:
The relevant information from the linked page:
Step 1. Open your Windows start menu, search for the notepad application and then right click the notepad icon.
Step 2. Choose “Run as administrator” and then, while inside notepad, browse to folder (java.home\lib\security\java.security).
You can now edit and save that file in the same folder without any issues. To recap, the trick is that instead of directly opening a protected file in the associated application, you run the application first as an administrator and then open the file inside it.

1) Copy original java.security file to desktop.
2) Edit the file there and save it.
3) Copy the file to %JAVA_HOME%/\jre\lib\security
4) Replace the original file with modified one.

Related

Opening filetype using java and a specific .jar

I work in computational chemistry, so I need to view a lot of files (.cell, .geom, .castep, etc.) using JMol, a .jar molecular viewer. Is there any way I can set these filetypes to open in JMol by default in Windows 10, so that I can simply double click them like I can with other molecule viewers? Obviously setting them to open with Java or the .jar file individually doesn't work, and I can't figure out how to open the files with both.
You can set-up new filetype handlers within Windows Explorer for each filetype you specified, BUT only if you can work out the command that launches JMol to example file of each type as:
C:\absolutepathto\jmol.bat file
You will need to fix your PATH to reference javahome\bin directory and set JMOL_HOME. Alternatively you can edit your version of jmol.bat or make your own a copy of jmol.bat which calls the original with the settings of JMOL_HOME / PATH, or add:
set JMOL_HOME=\pathto\jmol
set JAVA_HOME=\pathto\javahome
rem Replace java ... with:
%JAVA_HOME%\bin\java ...
Then to register these scripts, right mouse on example of each file type and choose -> Properties to see the dialog, click Open with... "Change" and browse to pick your own version C:\absolutepathto\jmol.bat.
Hopefully then at next double-click from Explorer your script is launched. If it doesn't run add this as last line of the jmol.bat:
pause

Extraction APK : what are .png# files?

I would like to extract the images from an android game.
Firstly, I took the APK on my windows 10 laptop then I extracted the files (rename files.apk to files.apk.zip and extracted it with 7zip).
Inside my folders I got many .png files but I get an error when I try to open one. Each .png file has another file with the same name but with .png#. Some even have 2 otherfiles with them : one with .skel (can't open this one too) and .atlas (I can open it with notepad):
Did I make mistakes? What can I do to "repair" all these png files?
Thank you for you help!
If you are authorised to do so then you can apktool.
Its easy to use and may that #png files will be converted to some meaningful resource.
Installation for Apktool
Windows:
Download Windows wrapper script (Right click, Save Link As apktool.bat)
Download apktool-2 (find newest here)
Rename downloaded jar to apktool.jar
Move both files (apktool.jar & apktool.bat) to your Windows directory (Usually C://Windows)
If you do not have access to C://Windows, you may place the two files anywhere then add that directory to your Environment Variables System PATH variable.
Try running apktool via command prompt
Link

How To Open Files With .Jar (Java) Application?

Tough question here. How do you open a file in java, in the way that when you double click on the file it automatically opens in a java application.
I'm making a musicplayer (first real big Java project for me) and I have no clue how to acheive this. When you open, lets say, a .mp3 file it will open in whatever default program you have selected for it (such as VLC mediaplayer or Windows Media Player). What I want is to be able to set the .jar file of my application as the default program for .mp3 files, and then to be able to actually launch the files in the application.
When I currently try to open a file with the application I get a windows error saying "This app cannot be executed on your pc". But when I launch the .jar itself without doing it by trying to open a .mp3 file it runs just fine.
Does anyone know how to acheive what I want? Many thanks in advance!
---edit---
I do not mean that you can select a default program for the mp3 file. The problem is that windows throws the error shown above, and that I dont know how to handle the application being launched by opening a file (which does not ope due to the error).
I think the problem is that you have to open a file with a .exe , so you sshould use an exe wrapper (I use jsmooth: download here)
BUT, before you do that, you need to accept that info. So in the main class, the "args" is a list of info about how it's being launched. If you are opening a file, the array's first argument will be the opened file's destination. SO I would accept it like this:
if (args.length > 0) {
File f = new File(args[0]);
start_the_application_with_a_file(f);
} else {
start_the_application_without_a_file();
}
C:\ProgramData\Oracle\Java\javapath\java.exe -jar "C:\Program Files\YourApp.jar" %* within a batch-file (.cmd) might do it.

Why is a file being saved to a different directory path in NetBeans?

For some unusual reason, when I am using FileWriter for Java Netbean, the file gets written into this directory:
C:\Users\myname\AppData\Roaming\NetBeans\7.2\config\GF3\domain1
rather than to my working directory, which is at the desktop.
I used this code to check my User Directory, and it returns this:
System.out.println(System.getProperty("user.dir"));
INFO: C:\Users\myname\AppData\Roaming\NetBeans\7.2\config\GF3\domain1
which is obviously NOT my working directory where my source code is. I thought I could have accidentally configured Netbeans to change the directory, but I checked through NetBeans menu and can't figure out how to undo this.
I have never had this problem before in my previous projects. As simple as the following code, the file should appear in my working directory.
File file = new File("myFile.xml");
Instead now I'm being forced to enter the path name to make the file save into my working directory, which is not going to be dynamic if I change computer.
String dir = "C:\\Users\\myname\\Desktop\\Assignment\\IRAssignmentJ\\";
File file = new File(dir + "myFile.xml");
Please enlighten me how do I solve this.
rather than to my working directory, which is at the desktop
No it isn't. The current working directory is whereever the file got saved, by definition. If Netbeans chooses to change directory to where it was saved, there's nothing you can do about it. If you want it in your home directory, there is a system property for that. If you want it saved somewhere else, use a full pathname.
But the behaviour of the application under Netbeans is of little interest. What matters is when you run it as though standalone, like a customer would.

WFMLRSVCApp.ear file not found

I am trying to install Oracle 11g in my laptop. Im downloading the setup files from here:
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-win64soft-094461.html
I have downloaded win64_11gR2_database_1of2.zip and win64_11gR2_database_2of2.zip.
I have put them in the same folder and started the setup file from the 1of2 folder. I go until certain steps and finally during installation i get WFMLRSVCApp.ear file not found popup.
I googled and i see some solutions where 1of2 and 2of2 file should be unzipped to same folder and then start setup. I did the same couple of times but still im getting the same error. Any anyone guess what is missing?
extract win64_11gR2_database_1of2.zip into win64_11gR2_database_1of2 folder first.
Then extract win64_11gR2_database_2of2.zip into win64_11gR2_database_2of2 folder.
copy all 4 files in database/ stage/ components folder in win64_11gR2_database_2of2 folder(unziped) & paste them (no replacement) in database/ stage/ components folder in win64_11gR2_database_1of2 (unziped).
Then run the setup again. I experienced in it. It works..
What you have to do is copy what is inside components folder ( i think four files ) in win64_11gR2_database_2of2.zip and paste it inside the win64_11gR2_database_1of2.zip components folder and re run the setup . it works
If you are installing the Oracle Identity Management 11gR2, you might receive the WFMLRSVCApp.ear file missing during Installation error during the database installation.
The way to resolve this error is:
Make sure you downloaded two disk
win64_11gR2_database_1of2.zip
win64_11gR2_database_2of2.zip
Steps:
Right click the win64_11gR2_database_1of2.zip file and select
Extract Here.
The software will extract in the folder named database as below,
You can see the following folders and files under database\stage, note the Date modifiedfor Components folder.
Do the same for win64_11gR2_database_2of2.zip file and click extract here, the extracted file will be placed in the same database folder
Now check the Date modified
That's it, now you can start by clicking setup.exe under database folder.
Hope it helps to understand easily.!!
I had the same problem but it's an easy one to solve: Download WinMerge and use it to merge the 2 folders that come out of the zip file from Oracle. That will do it.
http://winmerge.org/
1) Normally extract win64_11gR2_database_1of2.zip and win64_11gR2_database_2of2.zip
2) Copy directory
C:\Users\Fatality\Downloads\win64_11gR2_database_2of2\database\stage\Components (from extracted win64_11gR2_database_2of2 directory)
to
C:\Users\Fatality\Downloads\win64_11gR2_database_1of2\database\stage\Components (in extracted win64_11gR2_database_1of2 directory)

Categories