Adding a package to java
I'm trying to use a package to write some programs out of a java book. (The package comes from the same book.) I read a tutorial at java.sun.com on adding packages to the jre/lib/ext folder. I made a .jar file (named bookclass.jar), put it there and was able to compile a sample program. However, when I tried to execute the program, it gives me this error:
Exception in thread "main" java.lang.NoClassDefFoundError: ann/easyio/Screen
at Greeter1.main(Greeter1.java:15)I also tried just putting the package in a folder and setting the CLASSPATH enviroment variable, which also allowed me to compile, but gave me the same error when trying to run.
Any help would be greatly appreciated
RE: Radish 21
I already have that in my class.
Here's the sample class: (the blank comments are to force line spacing)
/* Greeeter1.java is a simple first Java program that displays a greeting to a user */
/* Output: A greeting that includes the current date and time */
import ann.easyio.*; // Screen class
import java.util.*; // Date class
class Greeter1 extends Object
public static void main(String args[])
Date currentDate = new Date();
String today = currentDate.toString();
Screen theScreen = new Screen();
theScreen.println("Welcome! Today, " + today + ", you begin your study of Java!");
}Before I made the .jar file, the javac couldn't find the package while compiling. After I was able to copile, java couldn't find the package while executing. I checked, and there's no main in the ann.easyio.Screen class.
Re: YATArchivist
CLASSPATH was C:\j2sdk1.4.1_02\classes , and like I said before, when I put the package in the classes folder, the program compiled to a class, but the class would not execute.
I then deleted CLASSPATH when I tried the other solution
CLASSPATH isn't necessary to run the classes, is it?
Similar Messages
-
Revision: 10059
Author: [email protected]
Date: 2009-09-08 11:31:48 -0700 (Tue, 08 Sep 2009)
Log Message:
update two package-info.java files, and add one new one.
Modified Paths:
blazeds/trunk/modules/proxy/src/flex/messaging/services/http/proxy/package-info.java
Added Paths:
blazeds/trunk/modules/core/src/flex/messaging/util/concurrent/package-info.java
blazeds/trunk/modules/core/src/flex/messaging/validators/package-info.javaRevision: 10059
Author: [email protected]
Date: 2009-09-08 11:31:48 -0700 (Tue, 08 Sep 2009)
Log Message:
update two package-info.java files, and add one new one.
Modified Paths:
blazeds/trunk/modules/proxy/src/flex/messaging/services/http/proxy/package-info.java
Added Paths:
blazeds/trunk/modules/core/src/flex/messaging/util/concurrent/package-info.java
blazeds/trunk/modules/core/src/flex/messaging/validators/package-info.java -
Revision: 8245
Author: [email protected]
Date: 2009-06-25 12:07:07 -0700 (Thu, 25 Jun 2009)
Log Message:
adding option (package-description-file) to specify file containing package descriptions for asdoc.
Bugs: SDK-19755
QE Notes: None.
Doc Notes: None.
Reviewed by: Paul
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-19755
Modified Paths:
flex/sdk/trunk/modules/antTasks/src/flex/ant/AsDocTask.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocAPI.java
flex/sdk/trunk/modules/compiler/src/java/flex2/configuration_en.properties
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/ASDocConfiguration.javaRevision: 8245
Author: [email protected]
Date: 2009-06-25 12:07:07 -0700 (Thu, 25 Jun 2009)
Log Message:
adding option (package-description-file) to specify file containing package descriptions for asdoc.
Bugs: SDK-19755
QE Notes: None.
Doc Notes: None.
Reviewed by: Paul
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-19755
Modified Paths:
flex/sdk/trunk/modules/antTasks/src/flex/ant/AsDocTask.java
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/AsDocAPI.java
flex/sdk/trunk/modules/compiler/src/java/flex2/configuration_en.properties
flex/sdk/trunk/modules/compiler/src/java/flex2/tools/ASDocConfiguration.java -
Problem with "package-info.java" using EJB 3.0 and OC4J
Hi all.
I already posted this question on JDeveloper forum, but didn't get any answer,
so I'll try posting here.
Anyway, I'm new both to JDeveloper and J2EE,
so I'm trying out examples for EJB 3.0, and I got stuck at "Use Security Annotations with EJB 3.0"
(http://www.oracle.com/technology/tech/java/oc4j/ejb3/howtos-ejb3/howtoejb30security/doc/how-to-ejb30-security-ejb.html).
Example code is working perfectly, if one builds it using Ant, but I'm importing all examples into JDeveloper (or at least I'm trying to :))
JDeveloper can't build file "package-info.java" containing following code:
@javax.annotation.security.SecurityRoles(roleNames={"superuser", "user"})
package oracle.ejb30;I'm getting following output in "Compiler - Log" window:
Error(2,1): 'class', 'interface', or 'enum' expected.
Help much appreciated...
platform used:
Windows XP SP2
JDeveloper Studio (Version 10.1.3, Build 3412)
JDK 1.5_06
OC4J 10.1.3 developer preview 4 (standalone version)Since you're using EJBs, you can use JTA and can skip the getTransaction() calls. If you want to use getTransaction().begin() and commit(), then make sure that your EntityManager is resource-local. The configuration for this is in persistence.xml. Set a transaction-type of RESOURCE_LOCAL rather than JTA.
-
How to import DBMS_LOB package in java
hi
how we can use pl/sql's package in java
any body can help me
where i can found harachy of DBMS_LOB package
to include in my java or jsp program
thanxperhaps this topic can help :
Calling PL/SQL from Java
and the use of DBMS_LOB package is here:
Supplied PL/SQL Packages and Types Reference Contents / Search / Index / PDF
http://download-east.oracle.com/docs/cd/B10501_01/appdev.920/a96612.pdf
Java Stored Procedures Developer's Guide Contents / Search / Index / PDF
http://otn.oracle.com/pls/db92/db92.docindex?remark=homepage
I hope that can help you. Perhaps another person can give the excat code.
Good luck!
Joel P�rez -
I downloaded CS6 Red Plug-In and added to Package Contents, replaced the current files with the new without backing up, now my RED footage thumbnails and color-correction don't WORK! How do I get my old importerRed file back!!?? HELP!
Try asking in the Premiere Pro forum seems to be an Adobe Lab for Premiere Pro
-
XML without namespace and prefix, modified package-info.java, JAX-WS option
Hello
I have created a consumer business service which will be called from JDEdwards EOne, pulls data from database and send it to Fusion Middleware.
SO, I have created proxy using JAX-WS option. And suggested in oracle doc, I created proxy outside OMW and then copied it to my project. XML payload is getting generated without namespace and prefix. After some research, I modified package-info.java. Now, I am able to send the payload and if test it locally from Jdeveloper and take xml output using marshaller I can see it has namespace and prefix as well. BUt, when I run this from server it does not have namespace and prefix.
Please help.
Thanks
TKJust to clerify,
The common complex types are StatusInfo, IdcProperty and IdcPropertyList. I ahve 3 more WSDL's with the exact same entires for those 3. -
Hi Guys,
I'm new in java world, and I have some questions, if anybody can help me plz.
1- The packages in java such java.sql and so on where we can downlad it?
2- How to add these packages to work with java?
ThanksThe following packages are already bundled with the jdk or jre you downloaded and installed:
java.applet
java.awt
java.awt.color
java.awt.datatransfer
java.awt.dnd
java.awt.event
java.awt.font
java.awt.geom
java.awt.im
java.awt.im.spi
java.awt.image
java.awt.image.renderable
java.awt.print
java.beans
java.beans.beancontext
java.io
java.lang
java.lang.annotation
java.lang.instrument
java.lang.management
java.lang.ref
java.lang.reflect
java.math
java.net
java.nio
java.nio.channels
java.nio.channels.spi
java.nio.charset
java.nio.charset.spi
java.rmi
java.rmi.activation
java.rmi.dgc
java.rmi.registry
java.rmi.server
java.security
java.security.acl
java.security.cert
java.security.interfaces
java.security.spec
java.sql
java.text
java.text.spi
java.util
java.util.concurrent
java.util.concurrent.atomic
java.util.concurrent.locks
java.util.jar
java.util.logging
java.util.prefs
java.util.regex
java.util.spi
java.util.zip
javax.accessibility
javax.activation
javax.activity
javax.annotation
javax.annotation.processing
javax.crypto
javax.crypto.interfaces
javax.crypto.spec
javax.imageio
javax.imageio.event
javax.imageio.metadata
javax.imageio.plugins.bmp
javax.imageio.plugins.jpeg
javax.imageio.spi
javax.imageio.stream
javax.jws
javax.jws.soap
javax.lang.model
javax.lang.model.element
javax.lang.model.type
javax.lang.model.util
javax.management
javax.management.loading
javax.management.modelmbean
javax.management.monitor
javax.management.openmbean
javax.management.relation
javax.management.remote
javax.management.remote.rmi
javax.management.timer
javax.naming
javax.naming.directory
javax.naming.event
javax.naming.ldap
javax.naming.spi
javax.net
javax.net.ssl
javax.print
javax.print.attribute
javax.print.attribute.standard
javax.print.event
javax.rmi
javax.rmi.CORBA
javax.rmi.ssl
javax.script
javax.security.auth
javax.security.auth.callback
javax.security.auth.kerberos
javax.security.auth.login
javax.security.auth.spi
javax.security.auth.x500
javax.security.cert
javax.security.sasl
javax.sound.midi
javax.sound.midi.spi
javax.sound.sampled
javax.sound.sampled.spi
javax.sql
javax.sql.rowset
javax.sql.rowset.serial
javax.sql.rowset.spi
javax.swing
javax.swing.border
javax.swing.colorchooser
javax.swing.event
javax.swing.filechooser
javax.swing.plaf
javax.swing.plaf.basic
javax.swing.plaf.metal
javax.swing.plaf.multi
javax.swing.plaf.synth
javax.swing.table
javax.swing.text
javax.swing.text.html
javax.swing.text.html.parser
javax.swing.text.rtf
javax.swing.tree
javax.swing.undo
javax.tools
javax.transaction
javax.transaction.xa
javax.xml
javax.xml.bind
javax.xml.bind.annotation
javax.xml.bind.annotation.adapters
javax.xml.bind.attachment
javax.xml.bind.helpers
javax.xml.bind.util
javax.xml.crypto
javax.xml.crypto.dom
javax.xml.crypto.dsig
javax.xml.crypto.dsig.dom
javax.xml.crypto.dsig.keyinfo
javax.xml.crypto.dsig.spec
javax.xml.datatype
javax.xml.namespace
javax.xml.parsers
javax.xml.soap
javax.xml.stream
javax.xml.stream.events
javax.xml.stream.util
javax.xml.transform
javax.xml.transform.dom
javax.xml.transform.sax
javax.xml.transform.stax
javax.xml.transform.stream
javax.xml.validation
javax.xml.ws
javax.xml.ws.handler
javax.xml.ws.handler.soap
javax.xml.ws.http
javax.xml.ws.soap
javax.xml.ws.spi
javax.xml.xpath
org.ietf.jgss
org.omg.CORBA
org.omg.CORBA_2_3
org.omg.CORBA_2_3.portable
org.omg.CORBA.DynAnyPackage
org.omg.CORBA.ORBPackage
org.omg.CORBA.portable
org.omg.CORBA.TypeCodePackage
org.omg.CosNaming
org.omg.CosNaming.NamingContextExtPackage
org.omg.CosNaming.NamingContextPackage
org.omg.Dynamic
org.omg.DynamicAny
org.omg.DynamicAny.DynAnyFactoryPackage
org.omg.DynamicAny.DynAnyPackage
org.omg.IOP
org.omg.IOP.CodecFactoryPackage
org.omg.IOP.CodecPackage
org.omg.Messaging
org.omg.PortableInterceptor
org.omg.PortableInterceptor.ORBInitInfoPackage
org.omg.PortableServer
org.omg.PortableServer.CurrentPackage
org.omg.PortableServer.POAManagerPackage
org.omg.PortableServer.POAPackage
org.omg.PortableServer.portable
org.omg.PortableServer.ServantLocatorPackage
org.omg.SendingContext
org.omg.stub.java.rmi
org.w3c.dom
org.w3c.dom.bootstrap
org.w3c.dom.events
org.w3c.dom.ls
org.xml.sax
org.xml.sax.ext
org.xml.sax.helpers
kind regards,
Jos -
Calling SQL packages from java
How do I call ORACLE sql packages from java?
We are still using Oracle 7.3. Any sample code
would be appreciated.utility.processPLSQL( connRisk,
" Begin "
+ " hvar_sum.p_load_var_summary_data("
+ " '" + dfCall.format( priceDate ) + "', "
+ " '" + promptMonth + "',"
+ daysBack + ","
+ aliasType + ","
+ "'" + connRisk.owner + "'"
+ "); "
+ " end ; ",
"Load VaR Summary Data",
utility.noLogMsg ) ;
public boolean processPLSQL(
MyConnection conn,
String sql,
String dataType,
boolean createLogMessage ) {
double startTime = conn.log.getStartTime() ;
try {
CallableStatement cs = conn.theConnection.prepareCall(sql);
cs.execute() ;
cs.close() ;
conn.theConnection.commit();
if ( createLogMessage ) conn.log.logTiming( dataType, startTime ) ;
} catch ( SQLException e ) {
conn.log.logError( "Utility.processPLSQL; SQLException Error: " + e ) ;
System.out.println(new java.util.Date().toString() + "; User: " + conn.user
+ "; SQL: " + sql );
return false ;
return true ;
} -
Prohibited package name: java.sql
hi,
i am trying to push a java application onto a JRun 3.1 server connecting to a oracle 8 database. in my servlet initialization, i use a connection pool to gain a connection to the database.
Class.forName("oracle.jdbc.OracleDriver");
outConn = DriverManager.getConnection(outUrl, outUsername, outPassword);
//throws error at the above line
this will throw an error:
java.lang.SecurityException: Prohibited package name: java.sql
this error is most peculiar because it runs fine locally on my developers version of JRun 3.1. but when i push it to a licensed version on a different server it gives this error. any hints?I believe that class name for the Oracle JDBC driver is oracle.jdbc.driver.OracleDriver. The one you posted is incorrect.
-
Creating package-info.java in Netbeans
I'm a little frustrated that Netbeans won't even let you create a 'package-info.java' file because of its naming rules. Is there any way to get around this?
I don't know NetBeans very well, so don't know of any workaround for the naming.
You can just name the file "package.html" and it will do the same thing. The drawback is that it won't allow for package annotations -- it can still have javadoc tags, though.
http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/javadoc.html#packagecomment -
Packages that java normally already imports
I am trying to get back into programming, and I remember awhile ago being told that java automatically imports certain packages, like java.lang, and maybe a couple more. I tried to test that out by using methods withing java.lang, or java.util, or java.io without importing those packages.
So I tried to test out java.util. I created an Arrays class without explicitly importing java.util. But my programming didn't recognize the class. I think it is possible that because of my directory structure the imports isn't working. But I'm not exactly sure how to make java see the packages in it's correct directory. Anybody can help? A more extensive question...what kind of environment does everybody use to code (windows environments please, that's what I'm using, I haven't set up a Linux box yet).I am trying to get back into programming, and I
remember awhile ago being told that java automatically
imports certain packages, like java.lang, and maybe a
couple more. I tried to test that out by using
methods withing java.lang, or java.util, or java.io
without importing those packages.
So I tried to test out java.util. I created an Arrays
class without explicitly importing java.util. But my
programming didn't recognize the class. I think it is
possible that because of my directory structure the
imports isn't working. But I'm not exactly sure how
to make java see the packages in it's correct
directory. Anybody can help? A more extensive
question...what kind of environment does everybody use
to code (windows environments please, that's what I'm
using, I haven't set up a Linux box yet).Only the public classes in the package java.lang are automatically imported. Here is some more information about packages from Sun's java tutorial:
http://java.sun.com/docs/books/tutorial/java/interpack/packages.html -
How many package in Java 1.1?
Do you know, How many package in Java 1.1?
Idiotic question, so here's an idiotic reply:
jar tf /path/to/java/lib/rt.jar |\
egrep -v '^(META-INF|com/sun|sun)' |\
sed -e 's/\/[^/]*$//' |\
sort -u |\
sed -e 's;/;.;g' |\
wc -lAnd if you change the last wc -l to more, you'll see the actual package names. -
Registering package in java??
heloo guys!
How to register a package in java???
Your post is greatly appreciated....
-=samer=-I mean i have download a jama package..there should be documentation available with instructions.
there should be a library that is a .jar file
your application needs to know where this .jar file is.
you tell it where it is by specifying the classpath.
you should know where this jar file is located
make sure it can be seen by specifying the classpath -
hi all,
Can any body suggest me a robust voronoi package in java. I already tried compuational geometry package which has some bugs in the generation of voronoi diagram.
Thanks in advance
- Ravi Settii needed to decompile something and modified it, now i need to compile it backDo you have permission for that?
db
Maybe you are looking for
-
Can one join a 2011 Mini to an older model, plus external HD?
I currently have the 2006 Mac Mini connected by firewire to a La Cie external hard drive. I would like to know if the new Mini can be connected to the existing mini -- and by extension the firewire HD -- Also would i need to purchase a separate editi
-
How to get Now() to display as mm/dd/yyyy hh:mm:ss?
I'm in the UK, and I have a form field that contains the value <%=Now()%> to get todays date. This gives me the following date format dd/mm/yyyy hh:mm:ss This is then used to INSERT into an MSSQL datetime field. However, when it inserts it reverts to
-
Converting fonts in PSD between Text Engines
Helo all, I get to the really distressful situation. I have been working on a big project in Photoshop CS6 and I did not noticed that the Text Engine Option was set to Middle Eastern. After a lot of layers has been added and lot of texts as well (usi
-
I just bought the Magic Trackpad, however OS X10.6.4 is required and I am running 10.5.8. I keep clicking on Software update but there aren't any updates. Any thoughts on how I can upgrade would be greatly appreciated.
-
Second Generation Ipod touch works only when plugged in, sometimes?
My ipod touch 2nd gen is having some issues. My friend gave it to me this way. He says it worked one night, charged it overnight, then went to turn it on the next day and it wouldn't turn on. So I got it then plugged it in and it starts turning on wi