Link to home
Start Free TrialLog in
Avatar of PRAC
PRAC

asked on

Jar and Policy file

Hi All,
      Earlier we used to execute our application using the run.bat file containing the following command:
java -classpath .\lib -D"java.ext.dirs=.\lib"
-Djava.security.policy==client.policy com.sciatl.svt.ui.Login

      Obviously it opens up a dos console which we are trying to avoid in the current release and the only option is to package all the class file in a jar file. With the help of the manifest file i am launching the Login class.

Here is the manifest file:

Manifest-Version: 1.2
Created-By: 1.3.1 (Sun Microsystems Inc.)
Main-Class: com.sciatl.svt.ui.Login
Class-Path: lib/classes12.jar lib/ejb.jar lib/jaas.jar lib/jaxb-rt-1.0-ea.jar lib/jta.jar lib/oc4j.jar lib/oc4jclient.jar

Now i don't know how to specify the client.policy file in my manifest file or can i specify my policy file somewhere?

Kindly let me know if you have any suggestions or ideas.

Thanks & Regards,
Prem.
Avatar of expertmb
expertmb

Avatar of Mick Barry
don't think you can sorry
You can avoid the console window by invoking javaw in stead of java
I don't know the answer about the policy file.
;JOOP!
Avatar of PRAC

ASKER

Even if i use javaw instead of java, when i double click my run.bat the dos console window comes up.
Avatar of PRAC

ASKER

I am able to ignore the dos window by adding "start" before javaw in my run.bat file. Now my run.bat contains:

start javaw -classpath .\lib -D"java.ext.dirs=.\lib"
-Djava.security.policy==client.policy com.sciatl.svt.ui.Login

Thanks & Regards,
Prem.
I presume you run on Windows98 or ME : indeed that's a bug.

;JOOP!
Avatar of PRAC

ASKER

The OS is Windows XP.
ASKER CERTIFIED SOLUTION
Avatar of helloexpert
helloexpert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PRAC

ASKER

I am able to set my policy file using the following line in my Login class:
System.setProperty("java.security.policy", "client.policy");

Thanks to "helloexpert".