Gridworld Case Study - how to use a .jar file with textpad

Hello,
I am a student currently working on a project involving the Gridworld case study. While trying to work on my project at home, I discovered that I would get new "cannot find symbol" compiler errors that I had not previously gotten while compiling the same code at school. I am assuming this has something to do with the .jar file included in the gridworld code. How do I get textpad and/or the java compiler to find and use the .jar file and reccognise the classes which i am importing and extending in my project?
Thanks,
-Alex

Thanks, It works for compiler now.
Now, I write a html to run the applet. appletviewer
says "
java.lang.NoClassDefFoundError: ij/process/ImageProcessor
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:1590)
at java.lang.Class.getConstructor0(Class.java:1762)
at java.lang.Class.newInstance0(Class.java:276)
at java.lang.Class.newInstance(Class.java:259)
at sun.applet.AppletPanel.createApplet(AppletPanel.java:566)
at sun.applet.AppletPanel.runLoader(AppletPanel.java:495)
at sun.applet.AppletPanel.run(AppletPanel.java:292)
at java.lang.Thread.run(Thread.java:536)
It seems the appletviewer can not find the right path for the package. How can I fix this?
Thank again,
Hillxy

Similar Messages

  • ServiceBus java callout - how to pack the JAR file with libraries?

    Hello
    I want to use a Java Callout from a Service Bus flow.
    What is the correct way to pack the JAR file with its nessecary libraries?
    I tried different methods to pack my JAR, but yet, as though the Java runs perfectly from the Workshop (Eclipse) , when I am trying to use the exported Jar on the ServiceBus flow, it fails with an ClassNotFoundException.
    I would really appreciate your advice here.
    Thanks
    Koby

    Well.. Looking inside my exported JAR file, I got all of the files there inside, including the jar file containing the library.
    What I'm trying to do is run a simple java program that connect through SSH and therefore use an SSH library.
    On the workshop I got it as an imported library JAR. And it works perfectly there.
    Any idea?
    Here's the complete error I get:
    <BEA-382515> <Callout to java method "public static java.lang.String sshpackage.SshProg.remoteScriptInvoke(java.lang.String,java.lang.String,java.lang.String,java.lang.String)" resulted in exception: null
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at stages.transform.runtime.JavaCalloutRuntimeStep$1.run(JavaCalloutRuntimeStep.java:158)
    Truncated. see log file for complete stacktrace
    java.lang.NoClassDefFoundError: ch/ethz/ssh2/Connection
    at sshpackage.SshProg.remoteScriptInvoke(SshProg.java:29)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    Truncated. see log file for complete stacktrace
    java.lang.ClassNotFoundException: ch.ethz.ssh2.Connection
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:283)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:256)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at com.bea.wli.sb.resources.archive.HookedJarClassLoader.loadClass(HookedJarClassLoader.java:251)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    Truncated. see log file for complete stacktrace
    Edited by: kobyssh on 04:12 01/02/2010

  • How to create and use library JAR files with command-line tools?

    Development Tools -> General Questions:
    I am trying to figure out how to put utility classes into JAR files and then compile and run applications against those JAR files using the command-line javac, jar, and java tools. I am using jdk1.7.0_17 on Debian GNU/Linux 6.0.7.
    I have posted a simple example with one utility class, one console application class, and a Makefile:
    http://holgerdanske.com/users/dpchrist/java/examples/jar-20130520-2134.tar.gz
    Here is a console session:
    2013-05-20 21:39:01 dpchrist@desktop ~/sandbox/java/jar
    $ cat src/com/example/util/Hello.java
    package com.example.util;
    public class Hello {
        public static void hello(String arg) {
         System.out.println("hello, " + arg);
    2013-05-20 21:39:12 dpchrist@desktop ~/sandbox/java/jar
    $ cat src/com/example/hello/HelloConsole.java
    package com.example.hello;
    import static com.example.util.Hello.hello;
    public class HelloConsole {
        public static void main(String [] args) {
         hello("world!");
    2013-05-20 21:39:21 dpchrist@desktop ~/sandbox/java/jar
    $ make
    rm -f hello
    find . -name '*.class' -delete
    javac src/com/example/util/Hello.java
    javac -cp src src/com/example/hello/HelloConsole.java
    echo "java -cp src com.example.hello.HelloConsole" > hello
    chmod +x hello
    2013-05-20 21:39:28 dpchrist@desktop ~/sandbox/java/jar
    $ ./hello
    hello, world!I believe I am looking for:
    1. Command-line invocation of "jar" to put the utility class bytecode file (Hello.class) into a JAR?
    2. Command-line invocation of "javac" to compile the application (HelloConsole.java) against the JAR file?
    3. Command-line invocation of "java" to run the application (HelloConsole.class) against the JAR file?
    I already know how t compile the utility class file.
    Any suggestions?
    TIA,
    David

    I finally figured it out:
    1. All name spaces must match -- identifiers, packages, file system, JAR contents, etc..
    2. Tools must be invoked from specific working directories with specific option arguments, all according to the project name space.
    My key discovery was that if the code says
    import com.example.util.Hello;then the JAR must contain
    com/example/util/Hello.classand I must invoke the compiler and interpreter with an -classpath argument that is the full path to the JAR file
    -classpath ext/com/example/util.jarThe code is here:
    http://holgerdanske.com/users/dpchrist/java/examples/jar-20130525-1301.tar.gz
    Here is a console session that demonstrates building and running the code two ways:
    1. Compiling the utility class into bytecode, compiling the application class against the utility bytecode, and running the application bytecode against the utility bytecode.
    2. Putting the (previously compiled) utility bytecode into a JAR and running the application bytecode against the JAR. (Note that recompiling the application against the JAR was unnecessary.)
    (If you don't know Make, understand that the working directory is reset to the initial working directory prior to each and every command issued by Make):
    2013-05-25 14:02:47 dpchrist@desktop ~/sandbox/java/jar
    $ cat apps/com/example/hello/Console.java
    package com.example.hello;
    import com.example.util.Hello;
    public class Console {
        public static void main(String [] args) {
         Hello.hello("world!");
    2013-05-25 14:02:55 dpchrist@desktop ~/sandbox/java/jar
    $ cat libs/com/example/util/Hello.java
    package com.example.util;
    public class Hello {
        public static void hello(String arg) {
         System.out.println("hello, " + arg);
    2013-05-25 14:03:03 dpchrist@desktop ~/sandbox/java/jar
    $ make
    rm -rf bin ext obj
    mkdir obj
    cd libs; javac -d ../obj com/example/util/Hello.java
    mkdir bin
    cd apps; javac -d ../bin -cp ../obj com/example/hello/Console.java
    cd bin; java -cp .:../obj com.example.hello.Console
    hello, world!
    mkdir -p ext/com/example
    cd obj; jar cvf ../ext/com/example/util.jar com/example/util/Hello.class
    added manifest
    adding: com/example/util/Hello.class(in = 566) (out= 357)(deflated 36%)
    cd bin; java -cp .:../ext/com/example/util.jar com.example.hello.Console
    hello, world!
    2013-05-25 14:03:11 dpchrist@desktop ~/sandbox/java/jar
    $ tree -I CVS .
    |-- Makefile
    |-- apps
    |   `-- com
    |       `-- example
    |           `-- hello
    |               `-- Console.java
    |-- bin
    |   `-- com
    |       `-- example
    |           `-- hello
    |               `-- Console.class
    |-- ext
    |   `-- com
    |       `-- example
    |           `-- util.jar
    |-- libs
    |   `-- com
    |       `-- example
    |           `-- util
    |               `-- Hello.java
    `-- obj
        `-- com
            `-- example
                `-- util
                    `-- Hello.class
    19 directories, 6 filesHTH,
    David

  • How to use external jar files ??

    Hi all,
    In my user-defined function for mapping (IR) , I want to make use a Class which is available in an external .jar file.
    Our XI is working on Windows2003 OS. I set the classpath in OS environment variables.
    But it is not working.
    Where I should set the classpath ?
    Can anyone help.
    Thanks in Advance
    Chemmanz
    Message was edited by: Chemmanz

    Hi Chemmanz,
    For user defined functions, it is not necessary to use the external jar files.
    Just follow the below steps:
           1.      To create a new user-defined function, choose <b>Create New Function</b> in the data-flow editor at the bottom of the screen, on the left-hand side.
           2.      Specify the attributes of the new function in the subsequent window:
    Name:
    Technical name of the function. The name is displayed in the function chooser and on the data-flow object.
    Description:
    Description of how the function is used.
    Arguments:
    In this table, you specify the number of input values the function can process, and name them. All functions are of type String.
           3.      In the subsequent window, you can create Java source code:
                                a.      You can import Java packages to your methods from the Imports input field, by specifying them separated by a comma or semi-colon:
    You do not need to import the packages java.lang., java.util., java.io., and java.lang.reflect. since all message mappings require these packages and therefore import them.
    In addition to the standard packages, you can also specify Java packages that you have imported as archives and that are located in the same, or in an underlying software component version as the message mapping.
                                b.      Create your Java source text in the editor window or copy source text from another editor.
           4.      Confirm with Save and Close.
           5.      User-defined functions are limited to the message mapping in which you created the function. To save the new function, save the message mapping.
           6.      To test the function, use the test environment.
    The new function is now visible in the User-Defined function category. When you select this category, a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the function to the data-flow editor, choose the arrow next to the button and select from the list box displayed.
    Regards,
    Prasad U

  • How to use a jar file

    Hi Everybody!
    waits for "Hi Dr.Nick" I need a program that will extract the text from a PDF and I think I may have found it here: http://multivalent.sourceforge.net/Tools/index.html
    However the instructions are a bit wacky and don't seem to work. My goal here is to extract the text from a pdf document so I am going by these instructions: http://multivalent.sourceforge.net/Tools/doc/ExtractText.html
    Currently when I follow the instructions and try to run "java tool.doc.ExtractText a.pdf" I recieve a ClassNotFoundException. the jar file I am using(Multivalent.jar) is currently located is /home/myusername/prog and the current CLASSPATH is also /home/username/prog. Can someone please explain to me what I am doing wrong?
    kthxbye

    Oblivious0823 wrote:
    Currently when I follow the instructions and try to run "java tool.doc.ExtractText a.pdf" I recieve a ClassNotFoundException. the jar file I am using(Multivalent.jar) is currently located is /home/myusername/prog and the current CLASSPATH is also /home/username/prog. Can someone please explain to me what I am doing wrong?You haven't set your classpath correctly. It should include the jar file.

  • How to "use" a xml file with a script?

    Hey Guys!
    I use the normal Button with the send-option to send the xml file to an url.
    My question is how it's possible to work in a php-script with the xml data out of the formular?
    Thanks for help.
    LG
    Adrian

    Hi,
    I need to read a XML document with StringReade class.
    My aplication receives an absolute path but this
    doesn't work:
    StringReader oStringReader =
    new StringReader(c:\java\libros.xml);
    However it works with:
    StringReader oStringReader =
    new StringReader("<?xml version="1.0" e......");
    ie, with the whole document as a String, but I need
    to do it as the frist way.
    Thankstake a look at this link:
    http://java.sun.com/webservices/jaxp/dist/1.1/docs/tutorial/sax/2a_echo.html

  • How to use external .tld files with uix

    Hey,
    I have a set of custom .tld files and that i was to use in my UIX pages. I got them to work correctly if I am using jsp files but for some reason it doesn't recognize the tags when they are in uix pages
    I far as I can tell, UIX actually requires xml schema definition of the tags and the just the .tld file is not sufficient.
    My question is, is this the correct conclusion?
    if so is there a easy way to either convert my tld file or create this xml schema file so that my tags will be visible to uix.
    or am I totally off the mark here...

    there is one utility in j2se jar and check the option also
    put that jar file in lib folder of yr application folder
    [email protected]

  • How to use a jar-file in an Application Service - NWDS 7.01

    Hello everybody,
    I want to create an Application Service in SAP NetWeaver Developer Studio 7.01.05. Can you explain me how i can import an external jar into my project?
    I found out that I can implement or create simple java files:
    Java Perspective --> package project_name.utils --> insert/create java file
    I try to add the jar into the java build path of my project, but when i build it the jar is gone.
    I would be very thankful for every hint.

    solved
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60d99678-1a29-2d10-94b4-9d9a67b7199b]

  • How to import a *.jar file with Jbuilder ?

    Hi,
    I just begin to use Jbuilder and when I use a sample with this line in the program:
    import com.borland.dbswing.*;
    The debugger find an error. In fact it cannot find com.borland....*;
    Do you know what to import how to find it and where to do it with Jbuilder
    Thanks, I am really lost

    JBuilder has this rather patronising notion of "libraries" - taking classpaths to a whole new level of idiocy!
    In "project properties" there should be a tab called "required libraries". I've no idea which library the package you want is in - have a look at the libraries that JBuilder comes with - it might be obvious.

  • How to use an HTML file with Parameters to make an audioClip

    HI guys,
    I am still working on getting simple sound to work in my program! I have learned that I can use Java.Applet's soundClip object, even when not using an Applet, but I do not know how to work with the URL object. Here is a SCCE so you can see where I am at!
    The Java Class:
    public class PlaySound {
        public static void main(String[  ] args)
        throws java.net.MalformedURLException
        java.applet.AudioClip clip = java.applet.Applet.newAudioClip(new java.net.URL(null));
        clip.play( );
    }The HTML file (Lets call it "file.html"):
    <html>
    <body>
    <param name="test" value="test.wav" />
    </body>
    </html>Now obviously I should not be passing the URL null, what should I pass it and how? Also, is the HTML file written properly? Thanks!
    -Christian S.
    Edited by: Christ_Guard on Jun 10, 2008 9:41 AM

    Christ_Guard wrote:
    Thanks! Thats exactly what I needed! Should I be saving my sound files in the bin Directory?That was just the simplest solution. Resources can be anywhere, as long as you know where! This icon tutorial gives some examples.
    [http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html#getresource]

  • Using a jar file in my application... how?

    I have a JAR file which contains some classes I need to use in my application. I however, after looking in several books, cannot figure out how to use this JAR file within my application.
    Do I simply put it in the directory with my .java files, and use an import command? I'm confused.

    If the classes in the jar are part of a package then you can import them based on the package structure. The jar file will have to be part of your CLASSPATH variable.
    i.e.
    myUtils.jar
    resides in C:\"My Classes"
    CLASSPATH = .;"C:\My Classes";"C:\My Classes\myUtils.jar"
    within the jar I have the following class:
    \ameyer\Util\someUtil.class
    \ameyer\Util\anotherUtil.class
    To use these classes I could use the following import statement
    import ameyer.Util.*;
    This would import any class at that level in the jar.
    Note: the import part of the CLASSPATH is "C:\My Classes\myUtils.jar"
    hope this helps.

  • How to use external jars in NW2004

    Hello Experts,
    can i use the same approach mentioned in the below Weblog for using the external jars in NW2004.
    /people/bertram.ganz/blog/2008/11/24/how-to-use-external-jar-files-in-web-dynpro-development-components
    and if not then what will be the best way to achieve it in  NW2004.
    Please provide your inputs on above.
    Regards,
    Siddharth

    Hi Sidharth,
    If you are using web dynpro DC perspective then you need to follow the following points to use the external jar files in it.
    1. Create a external library project.
    2. copy the external jars in the library folder os the projects.
    3.) Select all the jars from the u201CLibrariesu201D folder, Right click and then select Development Component and click on Add to Public Part
    4.Select the first Radio Button (Provides an API)and give some nameto it.
    5. Repeat the step no 3 but now select the second radio button other than as selected in step no 4.
    6. Now build your lirary DC.
    7. Now create a j2ee DC project.
    8. ) Expand the node DC Definition and Right Click on Used DC. Select Add Used DC.
    9. Select the External Library DC with build time dependency.
    10.Right click on the J2EE DC and then select Development Component followed by Build
    11. Right click on the J2EE DC and then select Development Component followed by Deploy
    now you can use both the libary DC and the j2ee DC in your web dynpro DC as used DC.
    But if you have created a web dynpro project only(but not DC) than you can directly add the external jars in java build path
    hope this will help
    regards
    Narendra
    Edited by: Narendra Singh on Oct 27, 2009 11:22 AM

  • How do we use our .jar file of Re-Usable Business Components in 11g?

    Hi All:
    We have developed a library of re-usable Business Components in 10g utilizing the instructions found here:
    http://download-west.oracle.com/docs/cd/B31017_01/web.1013/b25947/bcadvgen007.htm
    We are now planning on migrating to 11g, so we need to know how to implement this re-usable business component library.
    Is it possible to use it as it stands created in 10.1.3.3?
    Or do we have to migrate it over? And how is this done since we still have applications that use it in 10g?
    Your input is very appreciated since this is an important step in our migration plan. Doing this correctly is crucial to our shop. We have been trying a few things, so far with no luck.
    Thanks very muich.
    Mary
    UofW

    Shay:
    My colleague that received the errors is going to unexpectedly be off for a few days, so I tried to re-create the errors so that I could get back to you. What was essentially happening was that on certain tables, the first column was missing from the EntityImpl. These tables MIGHT be those that had a primary key that when JDev removed the underscore, had the same name as the Oracle table. For example the table name was ResidenceCode and the primary key of that table was Resident_Code and was found as the first column in the table. HOWEVER, when I tried migrating our reusable business components libarary .jar file, using 11.1.1.2.0, I did not experience the same errors, so I'll get back to you. She was perhaps using an older version of 11g?
    But I do have one question. Can we use a .jar file of reusable business components built in 10g in 11g? As you can imagine, this library is being used in other applications, and we'd like to prevent having two copies, if at all possible. Because of all the structural changes, I am guessing we can't, but I'd really appreciate your reply.
    I have found the documentation *36.7 Working with Libraries of Reusable Business Components* at http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcadvgen.htm#CHEFECGD with respect to 11g. If you know of any other 11g considerations with respect to this task, that would be great as well.
    Thanks Shay, I really appreciate hearing from you.
    Mary
    UofW

  • How to use client.jar generated by deploytool for a EJB web service

    Hello!
    Could anyone help me?
    I use Sun Application Server to deploy my EJB module and expose it as a web service. Then I open deploytool tree and select localhost under Server branch. In the right panel it shows a list of web services deployed. I chose recently deployed service and press "Client Jar..." button to get generated client stubs.
    Good.
    Could anyone tell me how I should use this jar file? It does not contain ..._Service_Impl.class that is usually used to get service port and call service methods.
    Please, explain me.
    Thank you much

    try
    jar tf Client.jar and look at what is inside.
    Usually you run the client to connect to the server -- (java -classpath blah pack.age.name.Client)
    Dont know how its being done over there.

  • How to load a Jar file in the class path?

    How to load a Jar file which contains class files, images, etc.. in the classpath without using URLClassLoader.

    You don't "load" jars. If it's on the classpath, you can obtain individual resources from it using various methods on either Class or ClassLoader. Do you mean "how to add a jar to the classpath at runtime"? Can't be done without using a classloader, typically URLClassLoader or a subclass thereof. Why you want to not use the proven method is beyond me. Presumably because you don't understand classloading. In which case, forget it.

Maybe you are looking for

  • JNI_CreateJavaVM fails in Multithreaded app.

    Hello, when i call JNI_CreateJavaVM in a multithreaded application, I ll get the error: "ERROR: Could not find the pthread library (2). Are you running a supported Linux distribution?" So, given the following program, everyhing works okay: ----code--

  • Upward swipe is not registering in iOS7 to bring up control center

    Hi there. Basically, I just recently installed iOS7 on my iPhone 4. So far everything has been working really well, except for the control center. This is not related to that other security bug. My problem is, swiping upward on the phone works less t

  • Filled redo log files are available to LGWR for reuse

    Hi, Oracle version: Oracle Database 10g Release 10.2.0.4.0 - OS:Windows XP In oracle documentation it is mentioned that: Filled redo log files are available to LGWR for reuse depending on whether archiving is enabled. *> If archiving is disabled (the

  • OO4O and PerlScript

    I am currently using VBScript and OO4O to access and manage an Oracle 8.0 database and was wondering if Perlscript will work with OO4O? Thanks

  • In Spry menu, can I make the dropdown colors different from the main one?

    In this menu at the link, I would like to keep "who we are" in the color it is, but make its submenu colors different. I can't see to find in the CSS where to do that without changing both the main and sub menu colors. Homepage