Invoking jar through jar

Advertisement

hi all,
I have exported the "frames.java" file into a jar file called "frames.jar". I have also exported "invokejar.java" file into a jar file called "invokejars.jar".
On doubleclicking invokejars.jar file, its not invoking frames.jar file. But when i execute invokejars.jar file through command prompt it works fine. Please help me to solve this problem.
frames.java
import java.awt.*;
import javax.swing.*;
public class frames extends JFrame
     public frames()
          super("Frames");
          setLayout(null);
          setSize(500,500);
          setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          setVisible(true);
     public static void main(String[] args) {
          // TODO Auto-generated method stub
          frames fr=new frames();
invokejar.java
import java.io.*;
public class invokejars
public static void main(String arg[])
try
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("cmd.exe /C java -jar frames.jar");
catch(Exception er)
               System.out.println("Exception is :"+er);
Thanks in advance
Regards

Advertisement

Is any part of the code firing? If not, double check your classpath. CLASSPATH should be set in the env file (default.env) and not the system environment. What you posted seems like it is missing some entries. Here is an example of the default CLASSPATH setting from an 11.1.1.4 installation.
CLASSPATH=C:\Oracle\Middleware\as_1\forms\j2ee\frmsrv.jar;C:\Oracle\Middleware\as_1\jlib\ldapjclnt11.jar;C:\Oracle\Middleware\as_1\jlib\debugger.jar;C:\Oracle\Middleware\as_1\jlib\ewt3.jar;C:\Oracle\Middleware\as_1\jlib\share.jar;C:\Oracle\Middleware\as_1\jlib\utj.jar;C:\Oracle\Middleware\as_1\jlib\zrclient.jar;C:\Oracle\Middleware\as_1\reports\jlib\rwrun.jar;C:\Oracle\Middleware\as_1\forms\java\frmwebutil.jar;C:\Oracle\Middleware\as_1/jlib/start_dejvm.jar;C:\Oracle\Middleware\as_1\opmn\lib\optic.jarDepending on your environment, it may be necessary to also add the importer to the classpath: C:\Oracle\Middleware\as_1\jlib\importer.jar
Given all that, why are you using a remote web service for a calculator rather than something like a java bean which will run locally? There is an example in the Forms demo set and likely many others on the web.
http://www.oracle.com/technetwork/developer-tools/forms/downloads/index.html
There is a calculator bean on a web site we often recommend, but be aware they appear to be having some site problems, so it may not be accessible.
http://forms.pjc.bean.over-blog.com/article-35505095.html

October 11, 2015

Invoking jar through jar

hi all, I have exported the "frames.java" file into a jar file called "frames.jar". I have also exported "invokejar.java" file into a jar file called "invokejars.jar". On doubleclicking invokejars.jar file, its not

JSE8 and mail.jar, activation.jar

Hey, all. Does anyone know if there are new mail.jar and activation.jar files for the Sun Java Studio Enterprise 8 system that support the new mail standard 1.4? I tried just putting these new jar files out in the \appserv8.1ur2\lib directory but tha

Wwjps.jar & wwjpstag.jar

I'm trying to build a JSP Portal Page, following the documentation "Oracle HTTP Server Integrating JavaServer Pages with Oracle9iAS Portal" I cannot find the wwjpstag.jar or wwjps.jar in the JPDK. Can someone email it to me and any other files (

Java -jar oc4j.jar -properties

hi, I run following this one. i got a error please rectify that java -jar oc4j.jar -properties *09/05/13 16:11:11 Invalid jsp taglib location: C:\Documents and Settings\nvinodh* *\Desktop\oc4j\j2ee\home\%s_javapOracleHome%\j2ee\home\jsp\lib\taglib do

Jars within Jar

Hello All, I have written a custom ant task and have made a jar and placed it in Ant's lib directory. The jar file has some dependencies which are jar files them selves (jdom.jar,commons-lang.jar and javagit.jar to be exact). It also has a dependency

Jar command jar -uf doesn't work on Vista

I try to use the jar command jar -uf to add information from a JAR into another. This works fine on XP, but not on Vista. I use the same commands and the same files on Vista and XP, but I get this error message on Vista: java.io.IOExeption: An error

How to launch jar through url

hi Andrew Thompson, I have problem to launch jar (swing application) through url.I know that i can do it with the help of jnlp but i m unable to find out the procedure to create jnlp. I tried hard to sign the jar which is the step of creating jnlp bu

Getting feilds in place of enum properties through jar.

Hello I am faced a very strange problem in my code.I made a serializable class,a few public fields in it and a public enum. Now i pack the class in a jar and deploy it.When i try to access the properties of the enum,i get the feilds!! Can anyone plea

Images not getting Loaded while running Java Application through jar file

Hello Friends, I have a problem while starting my application.I have written my application using pure java.There is no JSP or anything just pure swings.Mine is a standalone appplication.So i used to run it using a batch file.And when i used to start

Load jar from jar in applet

hi i made an applet that read xml files. i using in jaxp.jar and in parser.jar currently i put them in ext folder in plug in. is there any other way to put them in my jar applet file and to load them from there.The xml stuff is one of the optional pa

Jar calling jar

what is the magic line that I have to add to my jar application in order to call another jar program ??? Regards AmnonDo as #4 said to call main method directly ('main' of whatever class would be called from the jar). Or, you'd have to use Runtime.ge

How to replace xalan.jar Saxon9.jar

Hi all, i want to replace my xalan with saxon due to performance issues. I got to know that saxon is more efficient, Can you please help me to do it. In xalan i have used the Serializer class, but it's no longer support the following code in saxon. B

Invoking gdb through a Java program as subprocess

Hi, I try to invoke the gdb through a java program using Runtime.exec(...) as a Process, I also try to get the output of gdb using InputStream object, Is there any way to provide the options to gdb when it is started as Process & also tracing it's ou

Invoke workflow through Custom.pll

All, We have a requirement to invoke Workflow process for every service request create / update and I am calling the wf like below in custom.pll WHEN-VALIDATE-RECORD XXPPS_CRM_WF_PROCESS.XXPPS_WF_LAUNCH (                                     08291302 

Ojdbc6.jar ojdbc14.jar anamoly and a bug

PROGRAM PreparedStatement ps = connection.prepareStatement( "select dob from pers", ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet.getString("dob"); Output: ojdbc14.jar: *6/1/2012 0:0:0* ojdbc6.jar: *2001-06-

Invoking activemq through axis webservice

Hi, I have written a java code to invoke activemq remotely, its working fine. But when I converted the java code to a webservice and when I tried to invoke the activemq through this webservice, it is not at ll invoking the activemq...........I dont k

Packing jars with jars

Hi, I have some classes I wrote that I want to pack as an executable jar. My classes depend on other jars to do their job. Can I pack all the dpendencies together in my jar, so I can ship it as a singe jar? If so, then how do I do that? How do I add

Unjarring and Jarring presigned jar and then signing with new certificates

The presigned JARs by Sun. Is it valid to do the following operation? - Unjar the activation.jar - remove the certificates. - jar the files - sign the jar and use it. This is to avoid two pop-ups for accepting the certificate.The jarsigner docs. indi

Issue with .jar file (double clicking)

Hi. I've been having a problem with a certain .jar file when I attempt to double click it. From my understanding, I was under the impression that when someone double clicks a .jar file, the contents are supposed to execute by itself (kind of like a .

How to automount jAR file in Linux!

hello, I am create JAR file. I want to put this JAR file in CD and if an user in linux platform can ablet to locate this JAR file in /usr/bin/myjar folder and open through java -jar jarFile.jar cmd using shell script. Is it possible to uto mount and