How to add classpath to manifest
ok i have a jar called javaquest.jar
to run it, this works fine:
java -cp .;javaquest.jar game.GameGUIbut this doesn't:
java -jar javaquest.jareven when i used this manifest:
Manifest-Version: 1.0
Created-By: My Name
Main-Class: game.GameGUI
Class-Path: javaquest.jarwhat am i doing wrong?
thanks
ok my manifest contains:
Manifest-Version: 1.0
Created-By: My Name
Main-Class: game.GameGUIhere is the command i used to package:
jar cfm javaquest.jar manifest.txt gamehere is the command i used to run it (and it worked):
java -cp .;javaquest.jar game.GameGUIwhat i want is for the jar to be double-clickable in windows, which i think means it needs to respond to the command:
java -jar javaquest.jarwhen i use that command, i get:
Exception in thread "main" java.lang.NullPointerException
at javax.swing.ImageIcon.<init>(Unknown Source)here is my file system:
javaquest.jar
--game(dir)
----[classes]
----images(dir)
------[images]and here is the statement in the code i am using to retrieve the image:
a_jlabel.setIcon(new ImageIcon(getClass().getResource("images/image.gif")));Message was edited by:
lost_in_java
Similar Messages
-
How to add the mail.jar file to my CLASSPATH ?
Hi;
I wish to Instal JavaMail 1.2
To use the JavaMail 1.2 API, i unbundle the javamail-1_3_1-upd.zip file.....and now, i would like to add the mail.jar file to your CLASSPATH.
My question is: how do you do this ?
- ok i did that for CATALINA_HOME & JAVA_HOME but how to add the mail.jar file to my CLASSPATH ??
1000 thanks.I think you're looking for "developer support", not packaged application support. different server, different batch of groups. . .
Since I have very little contact with devopers, I don't truly know. -
How to add jar files classpath in sun stdio creator
Hi,
i am using log4j-1.2.13.jar in my application.
how to add it to my classpath in sun stdio.
with regards
shannu sarmaHi there,
These threads will answer your question
http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=61842
http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=56060
Thanks
K -
How to add to java classpath?
I am wondering how to add/implement to java classpath. I think I might be missed out the classpath thing so my program doesn't work. I keep getting error message like: "cannot resolve symbol: method setDocumentHandler(BookCounter)" and warning messages like: "C:\Example\BookCounter.java :11: warning:org.xml.sax.HandlerBase in org.xml.sax has been deprecated." and "C:\Example\BookCounter.java :16: warning:org.xml.sax.HandlerBase in org.xml.sax has been deprecated."
If this is not because of classpath problem, kindly let me know what should I do?
My code as follow:-
========================
import java.io.*;
import org.xml.sax.*;
import org.xml.sax.HandlerBase;
import javax.xml.parsers.SAXParserFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
public class BookCounter extends HandlerBase
private int count = 0;
public static void main (String args[]) throws Exception
(new BookCounter()).countBooks();
public void countBooks() throws Exception
SAXParserFactory f = SAXParserFactory.newInstance();
SAXParser f2 = f.newSAXParser();
// Parser p = new com.jclark.xml.sax.Driver();
f2.setDocumentHandler(this);
f2.parse("file:///C:/books.xml");
public void startElement(String name) throws SAXException
if (name.equals("book"))
count++;
public void endDocument() throws SAXException
System.out.printIn("There are" + count + "books");The errors don't look like classpath problems. The first one is a result of it not being able to find a method in BookCounter (or more likely HandlerBase) that has the signature that you are attempting to use.
The warnings come from the fact that HandlerBase has been deprecated, just like the messages state. In other words, it has been replaced by a newer version, or incorporated into another class' functionality. Check the API for more information. -
Add classpath in an executable jar file
an executable jar file contains a manifest file with entry main-class: MyApplicationClass.
if we double click the jar file on Windows OS, main class is loaded.
my question is:
if classes in he jar file use classpaths which are not default, how to add those classpaths into manifest file to tell classes to use those classpaths?
it is similar to command line:
java -classpath c;\mypackage; .......; MyApplicationClassThanks, i will try soon.
here is another Q.
if i need to add tools.jar (JDK lib) as classpath in manifest file, it is as following in my PC
d:\install\java\jdk14101\lib\tools.jar.
but my customers install JDK in different path (should be considered as unknown), how to add it as entry Class-path for all customers? -
How to add class file to the project in netbean
Hi,
I am not sure if it is the right place to put the question. I just cannot find the way to add my existing java class file into the project in net bean.
Anyone can help?
Thanks a lotLook at the "classpath" entry on the Index tab in NB's Help. There are entries there that explain how to add existing classes and libraries to a project.
-
How to add my class into rt.jar file?
Hi, everyone!
I am using WinRAR to extract the package rt.jar and added
my class file to javax folder. Then I use jar c0vf to create
a package. After that, I restart my WSAD4.0.2. But it seems
that WSAD4.0.2 can not be started. (It stops at the welcome
screen for a long time.)
Anything wrong I have made? How to resolved the reouble?
Cheers,
George MaThanks!
Do you know how to add .class file to a project of WSAD4.0.2?
I use CLASSPATH, but always failed in IDE. But it works in
command line environment. I want to use some classes in a
.class file.
Can you help?
Cheers,
George -
How to add adverts in adnroid app
Hi,
I'm trying to add adverts in my app which is published on android. I'm using StageWebView and leadbolt (before it was admob) and i'm wondering if there is another way to do so? I tried to use adsense but i think it's impossible to do it on android app or am i wrong? And my question is - how to add adverts in android app published by flash cs5.5?
regards
Mikehttp://code.google.com/p/flash-for-mobile/
qq讨论群:56892018
version for android http://code.google.com/p/flash-for-mobile/
version for iphone and ipad https://github.com/lilili87222/admob-for-flash
this is a actionscript native extension for developer to ad advertisement to their air mobile application run on iphone or android.it very easy to use
admob for flash android this lib enable you to add admob ad to your flash air application to add native advertisement to your actionscript3 application you just need to do four step
1.replace D:\Program Files\Adobe\Adobe Flash Builder 4.6\sdks\4.6.1\lib\android\lib\resources\android-res.jar with android-res.jar
2. add this config to -app.xml
<android>
<manifestadditions><![CDATA[
<manifest android:installLocation="auto"> <uses-sdk android:targetSdkVersion="11"/> <uses-sdk android:minSdkVersion="8"/> <uses-permission android:name="android.permission.INTERNET"/> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/> <application><!-- <activity android:name="com.google.ads.AdActivity?" android:configChanges="keyboard|keyboardHidden|orientation"/> --> <activity android:name="com.google.ads.AdActivity?" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize |smallestScreenSize"/>
</application>
Unknown end tag for </manifest>
]]></manifestadditions>
</android>
3.add this config to -app.xml
<extensions>
<extensionid>so.cuo.ane.Admob</extensionid>
</extensions>
4. add code to your android air application like follow
test1(); private function test1():void { var admob:Admob=Admob.getInstance(); if(admob.isSupported){ admob.setUnitId(gid); admob.dispatcher.addEventListener(AdEvent?.onReceiveAd,this.adHandler); admob.dispatcher.addEventListener(AdEvent?.onFailedToReceiveAd,this.adHandler);
// admob.showRelation(AdMobAlignment?.ALIGN_BOTTOM,AdType?.BANNER);
admob.show(50,100,AdType?.BANNER);
}else{ trace("not support"); }
protected function adHandler(event:AdEvent?):void { trace("receive ad"); } -
How to add jar files in project?
Hi everyone,
Im stuck at one problem. I have third party API which are in jar files. I want to add reference those jar files in my projects. How to add all jar files at once in my project? Also, jar files are in different folders, like
rootFolder
{noformat} |- jar1.jar{noformat}
|- jar2.jar
|- Folder1
| |-subjar.jar
| |-subjar2.jar
|- Folder2
|- moreJars
How to add all these jar files at once in my project? If u need more information, I will provide...
Thanks in advanceYou can put the external references the in manifest of your own jar or you can do that at the bootstrap shell script.
-
How to add manual entry?
Hi,
Can anybody tell me how to add the manual to solaris , what`s the name of the packege.
Thanks a lot.Hi Matt,
if you speak about CLASSPATH you mean the environment-parameter PATH?
If yes,
D:\oracle\MIM\102\BIN>set PATH
Path=D:\oracle\MIM\102\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wb
em;C:\j2sdk1.4.2_17-x64\bin;C:\j2sdk1.4.2_17-x64;C:\j2sdk1.4.2_17-x64\jre;C:\j2s
dk1.4.2_17-x64\lib;D:\usr\sap\MIM\SYS\exe\uc\NTAMD64
In D:\oracle\MIM\102\BIN i see the follow files:
06.01.2009 23:27 539.648 OraOLEDB10.dll
06.01.2009 23:27 1.712 OraOLEDB10.tlb
06.01.2009 23:27 24.576 OraOLEDB10d.dll
06.01.2009 23:27 7.168 OraOLEDB10us.dll
06.01.2009 23:27 146.944 OraOLEDBgmr10.dll
06.01.2009 23:27 12.800 OraOLEDBpus10.dll
06.01.2009 23:27 9.216 OraOLEDBrfc10.dll
06.01.2009 23:27 7.168 OraOLEDBrmc10.dll
06.01.2009 23:27 187.904 OraOLEDBrst10.dll
06.01.2009 23:27 17.408 OraOLEDButl10.dll
Mfg
Rainer -
FInvoice How to add the SOAP frame thru XSLT transform
Dear All,
i have the following problem i have implemented as xslt codeto send data from SAP Idoc invoic to WS Finvoic .
the coding looking as following :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output encoding="ISO-8859-1"/>
<xsl:template match="/">
<!-- Create SOAP-Envelope -->
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd">
<!-- Create Header Container -->
<SOAP-ENV:Header>
<eb:MessageHeader xmlns:eb="http://www.oasis-open.org/committees/ebxml-msg/schema/msg-header-2_0.xsd" SOAP-ENV:mustUnderstand="1" eb:id="">
<eb:From>
<eb:PartyId>
<xsl:value-of select="Finvoice/SellerOrganisationUnitNumber"/>
</eb:PartyId>
<eb:Role>Sender</eb:Role>
</eb:From>
<eb:From>
<eb:PartyId>
<xsl:value-of select="Finvoice//SellerBic"/>
</eb:PartyId>
<eb:Role>Intermediator</eb:Role>
</eb:From>
<eb:To>
<eb:PartyId>
<xsl:value-of select="Finvoice//InvoiceRecipientAddress"/>
</eb:PartyId>
<eb:Role>Receiver</eb:Role>
</eb:To>
<eb:To>
<eb:PartyId>
<xsl:value-of select="Finvoice//InvoiceRecipientIntermediatorAddress"/>
</eb:PartyId>
<eb:Role>Intermediator</eb:Role>
</eb:To>
<eb:CPAId>yoursandmycpa</eb:CPAId>
<eb:Service>Routing</eb:Service>
<eb:Action>ProcessInvoice</eb:Action>
<eb:MessageData>
<eb:MessageId>
<xsl:value-of select="Finvoice//SellerReferenceIdentifier"/>
</eb:MessageId>
<eb:Timestamp>
<xsl:value-of select="Finvoice//InvoiceDate"/>
</eb:Timestamp>
</eb:MessageData>
</eb:MessageHeader>
</SOAP-ENV:Header>
<!-- Create Body -->
<SOAP-ENV:Body>
<eb:Manifest eb:id="Manifest" eb:version="2.0">
<eb:Reference eb:id="Finvoice" xlink:href="1009">
<eb:schema eb:location="http://www.finvoice.info/yrityksen_verkkolasku/ladattavat/Tekniset tiedostot/schemat/Finvoice.xsd"/>
</eb:Reference>
</eb:Manifest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<!-- Add Finvoice msg. as Payload Container-->
<xsl:text disable-output-escaping="yes">
<?xml version="1.0" encoding="ISO-8859-15"?>
</xsl:text>
<xsl:text disable-output-escaping="yes">
<!DOCTYPE Finvoice SYSTEM "Finvoice.dtd">
</xsl:text>
<xsl:processing-instruction name="xml-stylesheet">type="text/xsl" href="Finvoice.xsl"</xsl:processing-instruction>
<xsl:copy-of select="*"/>
</xsl:template>
</xsl:stylesheet
My problem is that I don't know how to add the doctype part via xslt:
<?xml version="1.0" encoding="ISO-8859-15"?>
<!DOCTYPE Finvoice SYSTEM "Finvoice.dtd">
could sombody give me input concerning this
Thank in advace.
Best regards !Hi,
I don't know if I completely understand your requirements,
however, if you have the field DocType in your Idoc Structure Message, like follow:
<EDI34243 doctype="XXX"/>
You can use:
<xsl:value-of select="@doctype"/> -
Can I specify classpath in MANIFEST.MF of a ear file?
Hi,
I know that one can specify classpath in MANIFEST.MF of a jar file, I'd like to know whether I can specify classpath in MANIFEST.MF of a ear file?
If yes, will the classpath specified affect all j2ee components in this ear file?(e.g. jar files,war files)
ThanksUnfortunately, yes, you'd have to edit the MANIFEST.MF
of each module within the .ear that has a dependency on
the bundled library. One workaround is to add the common
code to the server's classpath. However, that approach
doesn't work if the common code has dependencies on the
code packaged within the ejb-jars and .wars themselves.
--ken -
How to add third-party libs to Java WAS for my Webdynpro DC?
Hello all,
Here is my scenario:
I have some thrid-party libs(some jars) which is necessary to my Webdynpro application. It is ok to add these files in the webdynpro project's classpath. But because these jars are missing on my server, somy webdynpro app not works.
Could anyone give me some proposal for this kind of problem? How to add these jars to the J2EE server and access them in the webdynpro project?
Thanks and Best regards
DeyangHi Deyang,
Also add these jars in the <b>lib</b> folder of your WebDynpro application. Open the application in the <b>Navigator mode</b> and there under the folder structure you will find the lib folder. Copy and paste these required jars in this folder as well.
See this pic:
<a href="http://img508.imageshack.us/img508/4614/jars9jq.jpg">Put jar files in Lib Folder</a>
This will solve your problem.
Regards
Pravesh
PS: Please consider rewarding points if helpful and solved. -
How to add jar files to my custom component
Hi,
I have created a custom component through component wizard. I have to add jars, so the component will execute. Where to add those jar files? I tried adding it in classes folder, but its not working. Where to add it? and where else i have to make any changes?
Please provide inputs.
Thanks in advancein the Component manifest.hda file, mention the jar files to be installed...see example below
@ResultSet Manifest
2
entryType
location
component
MyCustomComponent/MyCustomComponent.hda
componentClasses
MyCustomComponent/classes/
componentExtra
MyCustomComponent/readme.htm
componentClasses
MyCustomComponent/classes/
componentClasses
MyCustomComponent/apachepoi/poi-3.8-20120326.jar
componentClasses
MyCustomComponent/apachepoi/poi-ooxml-3.8-20120326.jar
componentClasses
MyCustomComponent/apachepoi/poi-ooxml-schemas-3.8-20120326.jar
componentClasses
MyCustomComponent/apachepoi/stax-api-1.0.1.jar
componentClasses
MyCustomComponent/apachepoi/xmlbeans-2.3.0.jar
componentClasses
MyCustomComponent/apachepoi/ooxml-schemas-1.1.jar
componentExtra
MyCustomComponent/java/
@endnext step is to add classpath in MyCustomComponent.hda file in LocalData...see example below
@Properties LocalData
blFieldTypes=
preventAdditionalComponentDowngrade=0
hasPreferenceData=0
blDateFormat=M/d{/yy}{ h:mm[:ss]{ a}}!mAM,PM!tAmerica/Chicago
classpath=$COMPONENT_DIR/classes:$COMPONENT_DIR/apachepoi/poi-3.8-20120326.jar:$COMPONENT_DIR/apachepoi/poi-ooxml-3.8-20120326.jar
classpathorder=50
ComponentName=MyCustomComponent -
How to modify -classpath dynamically?
use classpath to execute an application:
java.exe -cp c:\lib; TheApp
while TheApp is running, maybe another classpath is required (i.e. user uses FileChooser from TheApp to select a directory: c:\any_dir).
my Q is:
how to add c:\any_dir as a new classpath dynamically afterwards to make TheApp's enviornment the same as following command:
java.exe -cp c:\lib; c:\any_dir; TheApp
thxYou cannot modify the class path specified on the command line on runtime.
However, what you can do is make a ClassLoader that loads classes from the path you want, and use it to load the classes you want. (Ugh what a horrible sentence..)
You can find sample code for creating a URLClassLoader e.g here: http://developer.java.sun.com/developer/onlineTraining/Security/Fundamentals/magercises/URLClassLoader/solution.html
Maybe you are looking for
-
I have a brand new PM G5 Quad and a pre-exisiting G4 PowerBook. I purchased the G5 as a DV workstation using Final Cut Pro etc. My current PowerBook will be retained for other uses. I initially did NOT use Migration Assistant as I preferred to instal
-
New Quantum Gateway G1100 Prohibited LAN devices?
Hi I just received a new Quantum Gateway for FiOS TV and Internet, the LAN ports on the device are covered with a sticker prohibiting other than consumer electronics to be used. What devices are the einsteins at FiOS refering to? Are they trying to
-
Where can I find the source code of java.*?
Hey guy Is there any way I can get the code of the classes under java.*? Some of the javadocs online are not quite clear to me, so I hope I can check the code directly instead of looking at the javadocs Thanks!
-
Can't use back arrow or website back icon
On eBay, after a search, I select an item from search and can't get back to search list from the item page. When you open Firefox back arrow menu, all listings (15 of them) are for the current (item) page. Nothing to go back to. I did a complete rese
-
Can anyone explain these "no sender" emails?