How can i put Jar Files in Java Runtime.?
HI,
how can i put jar files in JRE so that they are accessible every where.? is there some way.?
Regards,
AA
Closest you could get to this I think is to explode all your jars into the same parent directory. Then if you put that directory on the classpath, you should be able to access all classes in all jar files
Similar Messages
-
How can i put some file (xml) in root apk?
how can i put some file (xml) in root apk?
I put fileA in flash builder mobile project.
build apk.
fileA → "main.apk/assets/fileA" .
expect → "main.apk/fileA" .
PS: view apk by Winrar.
I have a Demo Android java project.
It uses armeabi/libcasdkjni.so .
build apk
↓
+assets
+lib
+META-INF
+res
-AndroidManifest.xml
-classes.dex
-CopyrightDeclaration.xml
-mmiap.xml ← fileA
-resources.arsc
-VERSION
i build an ANE include armeabi/libcasdkjni.so.
apk is missing mmiap.xmlall files will be embed in "assests"(floder in apk ,which includes swf file) in that way.
build apk
↓
+assets ← "assets"
+lib
+META-INF
+res
-AndroidManifest.xml
-classes.dex
-CopyrightDeclaration.xml
-mmiap.xml ← fileA
-resources.arsc
-VERSION -
How can I put download file back on dock?
How can I put download file back on dock?
Welcome to Apple Support Communities
If you want to put a folder in the Dock, open a Finder window and drag the folder to the right part of the Dock. In this case, you want to put the Downloads folder in the Dock again, so open a Finder window and drag Downloads from the Finder sidebar to the right part of the Dock -
How can i put back files that were accidentally put into trash
How can i put back files that were accidentally put into trash. I'm using Mountain Lion on my Mac Book Pro
command Z if it was the last thing you did.
Control (right) click on any item in the trash folder>> Put Back -
How can i put my files that are in my ipad to my computer
how can i put my files that are in my ipad to my computer, because i deled all them from my computer, but they are in my ipad.what am i supposed to do?
What kind of files are they and what apps are you using on the iPad with these files?
-
How can i put txt files in my i phone 4
how can i put txt files in my i phone 4
There are many apps for this.
I use idisk with mobileme.
You can search the apps store or do a forum search and find several others. -
How can i create Jar file using Eclipse IDE.
Hi Guys
Am new to java. I want convert my project into executable jar file.
In my project am using itext.jar.And some other folder.
already i create jar file.But its not working.only its working 4 modules after that its say file cannot found exception.but the file path is correct.i dont know why its happen.
This is my project folder strutre also
Log:->
src(folder)
logs(folder)
comments(folder)
lib-->itext.jar.
images-->1,gif
properties-->catconfig.properties (file)
now can i create jar file
this code also show error when i run the jar file
And this is my catconfig. properties file
fileName=total_system_log.log
DDSingle=DD_bysingleIP_comment.txt
DDRange=DD_byrange_comment.txt
NDPing=ping_comments.txt
NDFPing=fping_comments.txt
reportFileName=report.txt
moduleFileName=Modules.txt
propFileName=nameDetails.properties
Choice=DDSingle
logFileName=DDSingleIP_10.32.0.2.log
finalReport=FinalReport.txt
logFilePath=\logs\
commentFilePath=\\Comments\\
its very urgent for me . could u pls send my error and u r ideas.
thanks for u r Ansewering.
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.ArrayList;
public class LogReader {
public void getValuesFromFilesOnly(String Choice,String logFileName)
try {
ArrayList commentsList = new ArrayList();
ArrayList tempList = new ArrayList();
String userdir = System.getProperty("user.dir");
String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
String commentDir =ResourceBundle.getBundle("catconfig").getString(Choice);
String commentFilePath=ResourceBundle.getBundle("catconfig").getString("commentFilePath");
String currentdir1 =userdir+logFilePath+logFileName;
StringBuffer strBuff=new StringBuffer();
RandomAccessFile randomFile = null;
RandomAccessFile commentsFile = null;
String tempLine = null;
String commentLine = null;
String catVersion = null;
String finalReport=null;
int colon = 0;
int counter = 0;
boolean startFlag = false;
boolean endFlag = false;
boolean endOfFileFlag = false;
System.out.println("Log file checked----->"+currentdir1);
System.out.println("comments file used--->"+commentDir);
try {
randomFile = new RandomAccessFile(currentdir1, "r");
} catch (Exception e) {
System.out.println("exception@getValuesFromFilesOnly@begin : "+e);
System.out.println("hi test1");
String commentDir1=userdir+commentFilePath+commentDir;
try{
System.out.println("Comment Dir:"+commentDir1);
commentsFile = new RandomAccessFile(commentDir1, "r");
catch (Exception e) {
System.out.println("exception@getValuesFromCommentDirOnly@begin : "+e);
while ((commentLine = commentsFile.readLine()) != null) {
String checkLine = commentLine.substring(commentLine.indexOf("=")+1, commentLine.length());
String message = commentLine.substring(0,commentLine.indexOf("="));
commentsList.add(checkLine);
commentsFile.close();
String startComment = (String)commentsList.get(0);
String endComment = (String)commentsList.get(commentsList.size()-1);
strBuff.append(" CAT LOG REPORT \n\n");
while ((tempLine = randomFile.readLine()) != null) {
if(tempLine.contains("CAT version is :"))
colon = tempLine.indexOf("is :");
catVersion = tempLine.substring(colon+4,tempLine.length());
String version=tempLine;
strBuff.append("Version : "+catVersion+"\n");
System.out.println("catVersion is :"+catVersion);
commentsFile = new RandomAccessFile(commentDir1, "r");
while ((commentLine = commentsFile.readLine()) != null) {
String checkLine = commentLine.substring(commentLine.indexOf("=")+1, commentLine.length());
String message = commentLine.substring(0,commentLine.indexOf("="));
checkLine=checkLine.toLowerCase();
tempLine=tempLine.toLowerCase();
if(tempLine.contains(checkLine))
colon = tempLine.indexOf("info -");
catVersion = tempLine.substring(colon+7,tempLine.length());
strBuff.append(message+" ==> "+catVersion+"\n");
System.out.println(message+" ==> "+catVersion);
tempList.add(message+" ==> "+catVersion);
if (catVersion.contains(startComment)){
startFlag = true;
counter++;
System.out.println("*******startFlag**********"+startFlag);
if (catVersion.contains(endComment)){
endFlag = true;
System.out.println("*******endFlag**********"+endFlag);
if (startFlag == true && endFlag == true){
System.out.println("******************************************");
System.out.println("-------------Successfull completion-------");
System.out.println("******************************************");
startFlag = false;
endFlag = false;
counter = 0;
tempList.clear();
if (startFlag == true && endFlag == false && counter > 1){
System.out.println("******************************************");
System.out.println("---------------Failure after-----:"+tempList.get(tempList.size()-1));
System.out.println("******************************************");
//startFlag = false;
//endFlag = false;
counter = 0;
tempList.clear();
commentsFile.close();
endOfFileFlag = true;
if (startFlag == true && endFlag == false && endOfFileFlag == true){
System.out.println("******************************************");
System.out.println("---------------Failure after-----:"+tempList.get(tempList.size()-1));
System.out.println("******************************************");
startFlag = false;
endFlag = false;
counter = 0;
tempList.clear();
randomFile.close();
System.out.println("hi");
finalReport=ResourceBundle.getBundle("catconfig").getString("finalReport");
savereportFile(strBuff,finalReport);
System.out.println("Report Generated");
} catch (Exception e){
System.out.println("Exception@getValuesFromFilesOnly : "+e);
public void findDetails()
String currentdir1 = ResourceBundle.getBundle("catconfig").getString("fileName");
String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
String userdir = System.getProperty("user.dir");
RandomAccessFile randomFile = null;
StringBuffer strBuff=new StringBuffer();
StringBuffer strBuff1=new StringBuffer();
StringBuffer strBuff2=new StringBuffer();
String tempLine = null;
String catVersion = null;
String timeStr=null;
String nameStr=null;
String startIP="";
String endIP="";
String tempStart="";
String tempEnd="";
String reportFileName="";
String moduleFileName="";
String propFileName="";
int startPos=0;
int endPos=0;
int fromIndex=0;
boolean versionFlag=false;
boolean ndFlag=false;
boolean ddFlag=false;
try {
randomFile = new RandomAccessFile(userdir+logFilePath+currentdir1, "r");
while ((tempLine = randomFile.readLine()) != null) {
if(tempLine.contains("CAT version is :") && !versionFlag)
startPos = tempLine.indexOf("is :");
catVersion = tempLine.substring(startPos+4,tempLine.length());
String version=tempLine;
strBuff.append("version : "+version+"\n");
versionFlag=true;
//System.out.println("version : "+version);
if(tempLine.contains("Inside NetworkDiscoverySlider.jsp"))
ndFlag=true;
strBuff.append("ND start : "+tempLine+"\n");
if(tempLine.contains("Inside NetworkDiscoveryDetails.jsp"))
strBuff.append("ND end : "+tempLine+"\n");
//System.out.println(" ND end : "+tempLine);
if(tempLine.contains("Given IPRange from"))
startPos = tempLine.indexOf("from");
catVersion = tempLine.substring(startPos+5,tempLine.length());
strBuff.append("NDRange : "+catVersion+"\n");
//strBuff.append("NDRange : "+tempLine+"\n");
//System.out.println("NDRange :"+catVersion);
startPos=0;
fromIndex=tempLine.indexOf(":");
endPos= tempLine.indexOf(':', fromIndex+2);
//System.out.println("fromIndex : "+fromIndex+" endPos : "+endPos);
timeStr=tempLine.substring(startPos, endPos);
nameStr=catVersion.replaceAll(" ", "_");
strBuff2.append("ND_"+timeStr+" "+catVersion+" = "+"NDRange_"+nameStr+".log\n");
if(tempLine.contains("inside ByIpAddress.jsp"))
ddFlag=true;
strBuff.append("DD Start : "+tempLine+"\n");
if(tempLine.contains("start_IpAddress:"))
startPos = tempLine.indexOf("start_IpAddress:");
catVersion = tempLine.substring(startPos+16,tempLine.length());
startIP=catVersion;
if(tempLine.contains("end_IpAddress"))
startPos = tempLine.indexOf("end_IpAddress");
catVersion = tempLine.substring(startPos+13,tempLine.length());
endIP=catVersion;
if(endIP.length()==0)
System.out.println("hi5");
strBuff.append("DDSingleIP : "+startIP+"\n");
//strBuff.append("DDSingleIP : "+tempLine+"\n");
//System.out.println("DDSingleIP : "+startIP);
//startPos = tempLine.indexOf(" ");
startPos=0;
fromIndex=tempLine.indexOf(":");
endPos= tempLine.indexOf(':', fromIndex+2);
timeStr=tempLine.substring(startPos, endPos);
strBuff2.append("DD_"+timeStr+" "+startIP+" = "+"DDSingleIP_"+startIP+".log\n");
else
strBuff.append("DDRangeIP : "+startIP + " to "+ endIP+"\n");
//strBuff.append("DDRangeIP : "+tempLine+"\n");
//System.out.println("DDRangeIP : "+startIP + " to "+ endIP);
//startPos = tempLine.indexOf(" ");
startPos=0;
fromIndex=tempLine.indexOf(":");
endPos= tempLine.indexOf(':', fromIndex+2);
timeStr=tempLine.substring(startPos, endPos);
strBuff2.append("DD_"+timeStr+" "+startIP+" to "+endIP+" = "+"DDRangeIP_"+startIP +"_to_"+ endIP+".log\n");
if(tempLine.contains("set percentage completedCount: 100"))
System.out.println("hi...1");
strBuff.append("DD End : "+tempLine+"\n");
//System.out.println("DD End : "+tempLine);
reportFileName=ResourceBundle.getBundle("catconfig").getString("reportFileName");
savereportFile(strBuff,reportFileName);
if(ndFlag)
strBuff1.append("Network Discovery\n");
if(ddFlag)
strBuff1.append("Device Discovery\n");
moduleFileName=ResourceBundle.getBundle("catconfig").getString("moduleFileName");
savereportFile(strBuff1,moduleFileName);
propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
savereportFile(strBuff2,propFileName);
} catch (Exception e)
System.out.println("error hi1");
System.out.println("Exception@findDetails : "+e);
public void savereportFile(StringBuffer strBuff,String targetFileName)
try{
String userdir = System.getProperty("user.dir");
String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
String reportFile=userdir+logFilePath+targetFileName;
String fileContent="";
fileContent=strBuff.toString();
//System.out.println("file content : "+fileContent);
FileWriter fileWriter = new FileWriter(reportFile);
if(fileContent!=null)
fileWriter.write(fileContent);
fileWriter.close();
catch(Exception e)
System.out.println("error hi1");
System.out.println("Exception@savereportFile : "+e);
public ArrayList<String> getFileNames()
String reportFile=ResourceBundle.getBundle("catconfig").getString("reportFileName");
String logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
String userdir = System.getProperty("user.dir");
RandomAccessFile repFile=null;
String reportLine = null;
int colon=0;
int fromIndex=0;
int startPos=0;
int endPos=0;
String timeStr="";
String fileName=null;
ArrayList<String> nameList=new ArrayList<String>();
try
reportFile=userdir+logFilePath+reportFile;
repFile = new RandomAccessFile(reportFile, "r");
while ((reportLine = repFile.readLine()) != null) {
if(reportLine.contains("NDRange"))
colon=reportLine.indexOf(" : ");
fileName=reportLine.substring(colon+3, reportLine.length());
fileName="NDRange_"+fileName.replaceAll(" ", "_");
nameList.add(fileName);
System.out.println("fileName : "+fileName);
if(reportLine.contains("DDSingleIP"))
colon=reportLine.indexOf(" : ");
fileName=reportLine.substring(colon+3, reportLine.length());
fileName="DDSingleIP_"+fileName.replaceAll(" ", "_");
nameList.add(fileName);
System.out.println("fileName : "+fileName);
if(reportLine.contains("DDRangeIP"))
colon=reportLine.indexOf(" : ");
fileName=reportLine.substring(colon+3, reportLine.length());
fileName="DDRangeIP_"+fileName.replaceAll(" ", "_");
nameList.add(fileName);
System.out.println("fileName : "+fileName);
repFile.close();
catch(Exception e)
System.out.println("Error@getFileNames : "+e);
return nameList;
public void writeFile(String oldLogName,String newLogName)
try
FileOutputStream writeFile=null;
String line = null;
String userdir = System.getProperty("user.dir");
String reportFile=ResourceBundle.getBundle("catconfig").getString("reportFileName");
String newLogPath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
RandomAccessFile repFile=null;
String reportLine = null;
String tempLine=null;
String prevLine=null;
String nextLine=null;
String target=null;
String tempStr=null;
String startStr=null;
String endStr=null;
int pos=0;
boolean flag=false;
boolean writeFlag=false;
boolean versionFlag=false;
//System.out.println("newLogName : "+newLogName);
newLogPath=userdir+newLogPath;
System.out.println("newLogPath : "+newLogPath);
BufferedReader buffRead = new BufferedReader(new FileReader(oldLogName));
writeFile = new FileOutputStream(newLogPath+newLogName+".log", false);//true-for append mode
DataOutputStream dout=new DataOutputStream(writeFile);
tempStr=newLogName.replace("_", " ");
pos=tempStr.indexOf(" ");
startStr=tempStr.substring(0,pos);
endStr=tempStr.substring(pos+1, tempStr.length());
target=startStr+" : "+endStr;
System.out.println("target ===> "+target);
reportFile=newLogPath+reportFile;
repFile = new RandomAccessFile(reportFile, "r");
while ((reportLine = repFile.readLine()) != null) {
if(reportLine.contains(target))
flag=true;
prevLine=tempLine;
//System.out.println("prevLine *****: "+prevLine);
else
tempLine=reportLine;
if(flag==true)
nextLine=reportLine;
flag=false;
//System.out.println("nextLine *******:"+nextLine);
break;
repFile.close();
if(prevLine!=null && prevLine.length()>0)
pos=prevLine.lastIndexOf(" : ");
prevLine=prevLine.substring(pos+3, prevLine.length());
//System.out.println("prevLine : "+prevLine);
else
System.out.println("Starting line not available for : "+target);
if(nextLine!=null && nextLine.length()>0)
pos=nextLine.lastIndexOf(" : ");
nextLine=nextLine.substring(pos+3, nextLine.length());
//System.out.println("nextLine : "+nextLine);
else
System.out.println("Ending line not available for : "+target);
nextLine=prevLine;
while ((line=buffRead.readLine()) != null) {
if(line.contains("CAT version is :") && !versionFlag)
versionFlag=true;
dout.writeBytes(line+"\n");
if(line.contains(prevLine))
writeFlag=true;
if(line.contains(nextLine))
writeFlag=false;
break;
if(writeFlag)
dout.writeBytes(line+"\n");
dout.writeBytes(nextLine+"\n");
buffRead.close();
System.out.println("done");
catch(Exception e)
System.out.println("Exception@writeFile : "+e.getMessage());
public String folderCheck(String foldName)
File folder=null;
File newFile=null;
String[] folderContent=null;
String tempFileName="";
String newLogName="";
int count=0;
String logFilePath="";
String fileName="";
String feedBackMsg="";
String userdir = System.getProperty("user.dir");
logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
fileName=ResourceBundle.getBundle("catconfig").getString("fileName");
folder=new File(foldName);
if(folder.isDirectory())
newLogName=userdir+logFilePath+fileName;
//System.out.println("newLogName : "+newLogName);
newFile=new File(newLogName);
if(newFile.exists())
newFile.delete();
folderContent= folder.list();
if (folderContent != null && folderContent.length>0)
System.out.println("folder has files : "+folderContent.length);
for(int iterate=0;iterate < folderContent.length;iterate++){
if (folderContent[iterate].toLowerCase().contains("system"))
count++;
tempFileName=foldName+"/"+folderContent[iterate];
try
FileOutputStream appendedFile=null;
BufferedReader buffRead = new BufferedReader(new FileReader(tempFileName));
appendedFile = new FileOutputStream(newLogName, true);//true-for append mode
DataOutputStream dout=new DataOutputStream(appendedFile);
String line = null;
System.out.println("writting : "+tempFileName);
while ((line=buffRead.readLine()) != null) {
dout.writeBytes(line+"\n");
buffRead.close();
//System.out.println("done");
catch(Exception e)
System.out.println("Exception@folderCheck : "+e);
if(count==0)
feedBackMsg="syslognotavail";
//System.out.println("System Log(s) not available");
else
feedBackMsg="syslogavail";
//System.out.println(count +" System log(s) avail");
else
feedBackMsg="filesnotavail";
//System.out.println("Files are not in the folder");
else
feedBackMsg="Dirnotavil";
//System.out.println("Directory not exists in the given name");
return feedBackMsg;
public ArrayList<String> loadFileContent(String selectedStr)
//System.out.println("inside loadFileContent()");
String logFilePath="";
String propFileName="";
String line="";
String choice="";
String tempStr="";
int startPos=0;
int endPos=0;
ArrayList<String> timeList=new ArrayList<String>();
String userdir = System.getProperty("user.dir");
try
logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
propFileName=userdir+logFilePath+propFileName;
BufferedReader buffRead = new BufferedReader(new FileReader(propFileName));
if(selectedStr.equalsIgnoreCase("Device Discovery"))
choice="DD";
else if(selectedStr.equalsIgnoreCase("Network Discovery"))
choice="ND";
while ((line=buffRead.readLine()) != null) {
if(line.contains(choice))
System.out.println(line);
startPos=line.indexOf("_");
endPos=line.indexOf(" =");
tempStr=line.substring(startPos+1, endPos);
System.out.println("tempStr : "+tempStr);
timeList.add(tempStr);
buffRead.close();
catch(Exception e)
System.out.println("Exception@loadFileContent : "+e);
return timeList;
public String getFileName(String timeStr)
System.out.println("inside getFileName");
String logFilePath="";
String propFileName="";
String line="";
String tempStr="";
int startPos=0;
String userdir = System.getProperty("user.dir");
try
logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
propFileName=ResourceBundle.getBundle("catconfig").getString("propFileName");
propFileName=userdir+logFilePath+propFileName;
BufferedReader buffRead = new BufferedReader(new FileReader(propFileName));
while ((line=buffRead.readLine()) != null) {
if(line.contains(timeStr))
System.out.println(line);
startPos=line.indexOf(" = ");
tempStr=line.substring(startPos+3, line.length());
System.out.println("tempStr : "+tempStr);
buffRead.close();
catch(Exception e)
System.out.println("Exception@loadFileContent : "+e);
return tempStr;
public ArrayList loadFile()
String logFilePath="";
String moduleFileName="";
String line="";
ArrayList<String> moduleList=new ArrayList<String>();
String userdir = System.getProperty("user.dir");
try
logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
moduleFileName=ResourceBundle.getBundle("catconfig").getString("moduleFileName");
moduleFileName=userdir+logFilePath+moduleFileName;
BufferedReader buffRead = new BufferedReader(new FileReader(moduleFileName));
while ((line=buffRead.readLine()) != null) {
moduleList.add(line);
buffRead.close();
catch(Exception e)
System.out.println("Exception@loadFile : "+e);
return moduleList;
public static void main(String[] args) {
System.out.println("Inside main");
//String userdir = System.getProperty("user.dir");
//System.out.println("userdir : "+userdir);
/*ArrayList<String> fileNameList=new ArrayList<String>();
String Choice="";
String logFileName="";
String logFilePath="";
String totalLog="";
String newLog="";
String folderName="";
Choice=ResourceBundle.getBundle("catconfig").getString("Choice");
logFileName=ResourceBundle.getBundle("catconfig").getString("logFileName");
logFilePath=ResourceBundle.getBundle("catconfig").getString("logFilePath");
folderName=ResourceBundle.getBundle("catconfig").getString("folderName");
totalLog=ResourceBundle.getBundle("catconfig").getString("fileName"); */
/*try
//to write the total log
//folderCheck(folderName);
//to find the details in the given log
//findDetails();
//to split the logs accordingly
totalLog=logFilePath+totalLog;
fileNameList=getFileNames();;
System.out.println("FileNameList size = "+fileNameList.size());
for(int i=0;i<fileNameList.size();i++)
newLog=fileNameList.get(i).toString();
writeFile(totalLog,newLog);
//to analyse the logs & to produce reports
//getValuesFromFilesOnly(Choice,logFileName);
}catch (Exception e)
System.out.println(e.getMessage());
}[JSP is used for server validation.
So you need a an application server (like Tomcat or Jboss) to execute your jsp files.
you can create the .war file of your simple jsp application and put it in the server.
then you will have to access your page using a web browser.
the URL will be
http://<ComputerName or IP Address>:<PortNumber>/<WarFileName>/<MainJspPage>
(eg: http://100.100.100.252:8080/SimpleApplication/mainPage.jsp)
-Achyuth -
How can we put .ICO file on JButton instead of JPG or GIF etc. files
How can we put .ICO(Icon file) file on JButton instead of JPG or GIF etc. files
Regards
SatinderjitShort answer:
You don't. ICO files are a native windows format.
Workarounds:
1) Convert your files to GIF.
2) Search for a library that can load ICO files.
3) Write a library that can load ICO files. -
How can we open any file using JAVA...
Hi all
i trying to make code in that code i choose a file using a filechooser then put that file name in FILE object like (File file = fileChooser.getSelectedFile();)
but the thing is how can i open that file for example if that file is HTML file then opens in IE or if that file is MS Word document that open in Word, like that
is there any suggestions
Thanx
Regards
Satinderjitstart is a windows command-line utility.
start foo.doc will start Word (or Star Office or Word Perfect or whatever is registered for the .doc extension),
start bar.htmnl will start your registered browser etc. -
How to run a jar file using Java application.
Hi all,
I know that jar file can run using the following command, using the command prompt.
java -jar jar-fileBut I don't know how to run that command through a Java code. Hope it's clear to you.
So can you please explain how can I do it.
Thanks,
itsjavarayon.m wrote:
The solution given by ropp appears to have nothing to do with what you asked about.Ok sir, I got the point.
I've try a test as follows. But it doesn't give any output. Even not an exception.
try {
String[] temp = new String[]{"java", " -jar", " MainApp.jar"};
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(temp);
int exitVal = proc.waitFor();
System.out.println("ExitValue: " + exitVal);
System.out.println("Temp_Values");
catch(InterruptedException ex) {
System.out.println(ex.getMessage());
catch (IOException ex) {
System.out.println(ex.getMessage());
}I've debug and see, but the exitValue is even not exist at run time. Can you tell me where I'm going wrong. -
How can I put a file in a directory server extracted by a abap report?
Hi!
I need to extract data from r/3 server by a report and put the output into one file in a directory of the server.
In Abap code someone know how can I do that?
Thanks!Hi,
I post this in the Abap forum but the response are very poor to make this. So, I think to post the message in XI forum because I work with thing of XI and I know that someone know how to put the file in the same server that I take out the data.
Tuhin give me a excellent link to make that!
Thanks! -
How can i put a file into blob(using sun.jdbc.odbc.JdbcOdbcDriver)
Hi
i tried to put a file into blob , but got a problem.....
My environment:windows 2000pro,JBuilder 5.0 enterprise,oracle 8.1.6,(not install oracle jdbc driver )
a part of program(my program is very uglily,if anyone want,later i paste it ba....~_~)
//Statement stmt2=null;
//Resultset rs2;
//opa1 is the blob data
void saveBlobTableToDisk(Connection con) {
try {
stmt2=con.createStatement();
sqlStr2="SELECT * FROM emp3 where id=1004";
rs2=stmt2.executeQuery(sqlStr2);
while (rs2.next()) {
Blob aBlob=rs2.getBlob("opa1");
i got the exception :
" null
java.lang.UnsupportedOperationException
at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(JdbcOdbcResultSet.java:4174)
at test3.Frame1.saveBlobTableToDisk(Frame1.java:48)
at test3.Frame1.<init>(Frame1.java:26)
at test3.Application1.<init>(Application1.java:5)
at test3.Application1.main(Application1.java:8) "
and the windows pop up a messagebox said that(about) my memory "0x09af007f" could not read, error in javaw.exe .
Later i used (ResultSet)getBinaryStream() to solve it. but getBinaryStream() only return a InputStream,so that i can make blob to a file,but i can't make a file to blob using jdbc.....
I am very stupid that installing sun java, oracle jdbc driver etc....(because i must set a lot of thing such as classpath,java_home etc), Can i only use JBuilder to do that ?
Or i must install oracle jdbc driver ?
Thanks.My guess here is that Sun's JDBC-ODBC bridge doesn't handle the BLOB datatype. Most ODBC drivers don't support that datatype, so I wouldn't expect the bridge to.
Is there a reason that you can't use the Oracle driver?
Justin -
How can i put a file into blob using jdbc !?
Hi
i tried to put a file into blob , but got a problem.....
My environment:windows 2000pro,JBuilder 5.0 enterprise,oracle 8.1.6,(not install oracle jdbc driver )
a part of program(my program is very uglily,if anyone want,later i paste it ba....~_~)
//Statement stmt2=null;
//Resultset rs2;
//opa1 is the blob data
void saveBlobTableToDisk(Connection con) {
try {
stmt2=con.createStatement();
sqlStr2="SELECT * FROM emp3 where id=1004";
rs2=stmt2.executeQuery(sqlStr2);
while (rs2.next()) {
Blob aBlob=rs2.getBlob("opa1");
i got the exception :
" null
java.lang.UnsupportedOperationException
at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(JdbcOdbcResultSet.java:4174)
at test3.Frame1.saveBlobTableToDisk(Frame1.java:48)
at test3.Frame1.<init>(Frame1.java:26)
at test3.Application1.<init>(Application1.java:5)
at test3.Application1.main(Application1.java:8) "
and the windows pop up a messagebox said that(about) my memory "0x09af007f" could not read, error in javaw.exe .
Later i used (ResultSet)getBinaryStream() to solve it. but getBinaryStream() only return a InputStream,so that i can make blob to a file,but i can't make a file to blob using jdbc.....
I am very stupid that installing sun java, oracle jdbc driver etc....(because i must set a lot of thing such as classpath,java_home etc), Can i only use JBuilder to do that ?
Or i must install oracle jdbc driver ?
Thanks.
D.T.My guess here is that Sun's JDBC-ODBC bridge doesn't handle the BLOB datatype. Most ODBC drivers don't support that datatype, so I wouldn't expect the bridge to.
Is there a reason that you can't use the Oracle driver?
Justin -
How can I add jar files into the namespace in code?
My friends:
I need to add jar files into my namespace dynamicly in my code.But the jar files might be repeated, I am not sure.so, i wonder how can I add them into my namespace, ignoring the repeated files?
This is my code:
URL[] urlArrayA = new URL[5];
urlArray[0] = sample1;
urlArray[1] = sample2;
URL[] urlArrayB = new URL[5];
urlArrayB[0] = sample3;
urlArrayB[1] = sample4;
URLClassLoader urlClassLoaderA = URLClassLoader.newInstance(urlArrayA);
URLClassLoader urlClassLoaderB = URLClassLoader.newInstance(urlArrayB);
how can i visit classes in urlClassLoaderA from classes in urlClassLoaderB?could anyone please answer the question for me ? thank you...
-
How can i import dll files in java project in eclipse?
Hi All,
How can i import or link dll files in java project in eclipse?....
dll files contains
import com.ms.com.ComLib;
import com.ms.com.Variant;
import com.ms.com.ComFailException;
import com.ms.wfc.data.AdoException;
import com.ms.wfc.data.AdoEnums;
Any idea of this please tell me.....
I am using eclipse 3.4 and JRE 1.4
Is this possible?
Please tell me!!!!!!!!!!!!!
VoddapallyiMovie cannot edit mpg files, unles they come directly from a supported camera.
I would suggest that you use a free third party app to convert it.
Get MPEG Streamclip from Squared 5, which is free.
Drag you mpg clip into MPEG Streamclip.
Then, FILE/EXPORT USING QUICKTIME
Choose Apple Intermediate Codec, and save it where you can find it. You should be able to import this file into iMovie, using the FILE/IMPORT/MOVIE command.
Note: If your file is an MPEG2 clip, you may need to purchase the Apple QuickTime MPEG2 Playback Component from Apple. MPEG Streamclip will tell you if you need this. Don't buy it unless you have to. It costs about $20. You just have to install the component. MPEG Streamclip will use it in the background.
Maybe you are looking for
-
More than one iphone in the family
Currently, I have an iphone, and of course iTunes and also mobileme. My wife now wants an iphone for herself. Can she share my itunes to sync her phone?? Or does she need a separate itunes?? What about mobile me?? Can she share my mobileme, or does s
-
Flash CS5 Windows 7 64-bits problem
Hello and thank you for reading my problem and trying to help. I actually have a Windows 7 Home Premium 64-bits. So I've downloaded, extracted and installed Flash correctly. When I try to open the software, on the loading screen, the loading slows do
-
I am trying to update I-tunes, but I get the following error message. Service Apple Mobile Device failed to start and wants me to verify I have sufficient priveledges to start system services. I do not know what to do. I am the only user on my HP Pa
-
Can we use NWBC with both SRM and ECC
HI Can we use NWBC both SRM and ECC . or do i have to use EP . Thanks, Pooja
-
Primary and DG in different version
Hi i want to try to use 10g primary with 11g stanby. In doc i read : The following conditions must be met before you can use the broker: ■ The primary and standby databases must be using the same version of Oracle Database 11g and each can be install