473,654 Members | 3,108 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Execute jar in program code

I have a jar file, without source code, say abc.jar.
I have set it in the CLASSPATH
The main execute class in abc.jar is a.class.
In the command prompt, I can execute the program by
issuing "java a < someIOfile"

But I would be like to embed it in my program.
Can I create a "dynamic" instance from it?
Jul 17 '05 #1
1 4196
Cyrus Lan wrote:
I have a jar file, without source code, say abc.jar.
I have set it in the CLASSPATH
The main execute class in abc.jar is a.class.
In the command prompt, I can execute the program by
issuing "java a < someIOfile"

But I would be like to embed it in my program.
Can I create a "dynamic" instance from it?


Sure. Just call "a.main(params) ". It's a static method no different
from any other Java method, so you can call it as you desire from within
any Java code.

Brad BARCLAY

--
=-=-=-=-=-=-=-=-=
From the OS/2 WARP v4.5 Desktop of Brad BARCLAY.
The jSyncManager Project: http://www.jsyncmanager.org


Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
6587
by: BlackHawke | last post by:
Our program, game program Andromeda Online (www.andromedaonline.net) uses two programs- one to play the game, another to patch the game as updates come out. Players actually launch the updater which checks for fresh updates, then installs them, then launches the game client. We have begun our beta test, and would like to have the client open with a console window so that players can see exceptions that are thrown. How to do this seems to...
11
4897
by: penguinman | last post by:
I type ./a.out and the shell just sits there. It doesnt hang it just sits there looking pretty. I run the program with the ddd option and executed it from ddd...execution window comes up and nothing shows up. I used anjuta same thing. No compiler errors no warnings but it wont execute. Checked the permisions of the file and its execute..tried with no execute from desperation,....same shit. And yeah i got make.
0
2049
by: Eric Wood | last post by:
We have an application that is accessed using shared drives, client executes program from server. We have already coded the program to create and save the a bat file either locally on the users machine or on the server. Our problem is that when we execute the bat file from the vb code it does not work properly. The bat file is used to connect to a commnad line service running on the server and update a file in another system. We can...
4
3584
by: cmrchs | last post by:
Hi, executing the following on a local drive works fine : FileStream wLog; wLog=File.OpenRead(@"d:\Log.txt"); but executing the same code on a network drive creates a FileIOPermission-exception. although the user has full control on the drive where the application is running. Actually, any IO-statement creates an exception ???
4
7866
by: Chris | last post by:
I posted this in the C# language group, then thought it might be more appropriate in this group. I would not cross-post except I want the answer so badly. I built small C# Web and Web Service applications in a training class last week. The applications worked in the class, but when I tried to run them again over the weekend, they both bombed. Instead of getting my Web page, or the Web Service page, I get a page full of error text...
1
14639
by: Eric Wood | last post by:
We have an application that is accessed using shared drives, client executes program from server. We have already coded the program to create and save the a bat file either locally on the users machine or on the server. Our problem is that when we execute the bat file from the vb code it does not work properly. The bat file is used to connect to a commnad line service running on the server and update a file in another system. We can...
9
1482
by: BoloBaby | last post by:
I have an extremely vexing problem occurring in a program that I am writing. Consider the following block of code: Dim pDancer As New BEDancer mintIndex = mintIndex + 1 pDancer.DancerName = "Dancer #" & mintIndex pDancer.DancerStatus = BEDancerStatus.BE_AVAILABLE pDancer.CardID = mintIndex oBEDancerList.AddDancer(pDancer)
2
2029
fungazid
by: fungazid | last post by:
Help help help please I’m using DBD::mysql, and I want to insert a record into clients table (id, address, and phone-number of a client): my $str= “?,?,?,,,”; my @args1=('Zalman','Zalmanovich',12121,'New York'); $q=$dbh->prepare("INSERT INTO $table VALUES($str)")
5
7053
by: sayeo87 | last post by:
Hi, I am quite new to JSP so please forgive me if I ask really simple things... I am trying to run system commands on the server and display the output on a webpage. This is what I've got: <%@ page import="java.io.*" %> <HTML> <BODY> <% Runtime rt = Runtime.getRuntime(); Process p = rt.exec("/bin/ls");
0
8372
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8285
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8706
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8591
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7304
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5621
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2709
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.