NEW CLASS FILES

I need to use some different class files to the ones that come with the SDK. Where do I need to put them so that I can import them...? At the moment they are in a folder on my c: drive, but the import keyword cannot find them.. can sumone help? Please email me if you can...
[email protected]

I've tried putting it in the classpath, and its says:
C:\java_code\sheep.java:1: package ann.easyio does not
exist
import ann.easyio.*;
^
C:\java_code\sheep.java:7: cannot access Screen
bad class file: C:\ann\easyio\Screen.class
class file contains wrong class: ann.easyio.Screen
Please remove or make sure it appears in the correct
subdirectory of the classpath.
     public static Screen output = new Screen();
my classpath is:
.;.;C:\PROGRA~1\JMF21~1.1\lib\sound.jar;C:\PROGRA~1\JMF
1~1.1\lib\jmf.jar;C:\WINDOWS\java\classes;.%CLASSPATH%;
:\ann\easyio;
i know these class files work cause i've used them at
uni...
help!!!???
thanksYou should have c:\ in your class path. The Screen.java contains a class called ann.easyio.Screen. Since your Screen.java file resides in C:\ann\easyio directory, to refer to that class you should put c:\ in your class path. It should work with that.

Similar Messages

  • Copying a new .class file for WLS to use, proper way?

    Hello. I'm doing some servlet development and I would like to know what is
    the proper way to deploy any .class files and servlets (also .class files)?
    If I just copy them into the proper directory, am I supposed to have to
    restart the server? Is that normal, or should WLS just pick up the new one?
    It does that with JSPs, can it do that with servlets and supporting classes?
    Thanks.

    I found out that I was copying the wrong file to the right place (.java
    instead of the .class :<). So once I fixed that small little :> problem, I
    was off and running. Thank you for your help! :>
    "Slava Imeshev" <[email protected]> wrote in message
    news:[email protected]..
    Hi Peter,
    Normally weblogic will redeploy automatically application, either web
    or ejb, without restarting the server, when it's copied to applications
    directory on the server. Applications should be properly packaged.Servlets
    and supported files should be in war file, ejb-s in ejb-jar files.
    I'm not sure if it would work right for plain unpacked class files.
    Regards,
    Slava Imeshev
    "PeterH" <!REMOVEBeforeSending! > wrote in message
    news:[email protected]..
    Hello. I'm doing some servlet development and I would like to know whatis
    the proper way to deploy any .class files and servlets (also .classfiles)?
    If I just copy them into the proper directory, am I supposed to have to
    restart the server? Is that normal, or should WLS just pick up the newone?
    It does that with JSPs, can it do that with servlets and supportingclasses?
    Thanks.

  • Problem when using a new class "File" in JSP

    I'm using Weblogic 4.52sp2 under Solaris 2.6 with JDK 1.2.1_04. I've got a problem with a JSP that uses a commercial bean which contains a specific "File" class. This class has its own package: com.jspsmart.upload.File. While compiling, Weblogic raises an exception:
              Fri Mar 09 14:41:38 CET 2001:<I> <ServletContext-Servlets> weblogic.servlet.JSPServlet: Generated java file: /data/html/compiledJSP/_jspsmartupload/_jsp/_sample2.java
              Fri Mar 09 14:41:43 CET 2001:<E> <ServletContext-Servlets> weblogic.servlet.JSPServlet: Compilation of /data/html/compiledJSP/_jspsmartupload/_jsp/_sample2.java failed:
              /data/html/compiledJSP/_jspsmartupload/_jsp/_sample2.java:46: Ambiguous class: java.io.File and com.jspsmart.upload.File
              f = new File("/data/html/jspsmartupload/jsp/sample2.jsp");
              I looked at the .java generated file but it seems that everything is OK: f is a java.io.File
              public class _sample1 extends weblogic.servlet.jsp.JspBase implements weblogic.servlet.jsp.StaleIndicator {
              // StaleIndicator interface
              public boolean _isStale() {
              java.io.File f = null; long lastModWhenBuilt = 0L, lastMod = 0L;
              f = new File("/data/html/jspsmartupload/jsp/sample1.jsp");
              lastModWhenBuilt = 984144952000L;
              lastMod = f.lastModified();
              if (!f.exists() || lastMod > lastModWhenBuilt) return true;
              return false;
              We can't neither change the bean (no sources) nor Weblogic JSP engine (of course). Has anyone a solution ?
              [att1.html]
              

    i think you should try this
              f = new java.io.File("/data/html/jspsmartupload/jsp/sample1.jsp");
              "Laurent PAILLARD" <[email protected]> wrote in message
              news:[email protected]...
              I'm using Weblogic 4.52sp2 under Solaris 2.6 with JDK 1.2.1_04. I've got a
              problem with a JSP that uses a commercial bean which contains a specific
              "File" class. This class has its own package: com.jspsmart.upload.File.
              While compiling, Weblogic raises an exception:
              Fri Mar 09 14:41:38 CET 2001:<I> <ServletContext-Servlets>
              weblogic.servlet.JSPServlet: Generated java file:
              /data/html/compiledJSP/_jspsmartupload/_jsp/_sample2.java
              Fri Mar 09 14:41:43 CET 2001:<E> <ServletContext-Servlets>
              weblogic.servlet.JSPServlet: Compilation of
              /data/html/compiledJSP/_jspsmartupload/_jsp/_sample2.java failed:
              /data/html/compiledJSP/_jspsmartupload/_jsp/_sample2.java:46: Ambiguous
              class: java.io.File and com.jspsmart.upload.File
              f = new File("/data/html/jspsmartupload/jsp/sample2.jsp");
              I looked at the .java generated file but it seems that everything is OK: f
              is a java.io.File
              public class _sample1 extends weblogic.servlet.jsp.JspBase implements
              weblogic.servlet.jsp.StaleIndicator {
              // StaleIndicator interface
              public boolean _isStale() {
              java.io.File f = null; long lastModWhenBuilt = 0L, lastMod = 0L;
              f = new File("/data/html/jspsmartupload/jsp/sample1.jsp");
              lastModWhenBuilt = 984144952000L;
              lastMod = f.lastModified();
              if (!f.exists() || lastMod > lastModWhenBuilt) return true;
              return false;
              We can't neither change the bean (no sources) nor Weblogic JSP engine (of
              course). Has anyone a solution ?
              

  • Loading new class files when they are not available when the JVM starts

    Simple Question
    Is it possible to load class if it was not compiled when the original JVM was launched?
    More Detailed Question
    Our build system is getting a slight tweak with a new test runner. After our build system compiles the file, I would like to be able to load the files that have just been compiled.
    Our build system runs inside its own JVM and calls ant scripts to run the different processes(Separate JVM). The new test runner will also be called from the build system(Same JVM) but not as an ant target. Is it possible to call the newly compiled files from inside the build system JVM if they had not been created on the start of that JVM using reflection?
    Thanks in Advanced!

    public class t
        public static void main(String args[])
         throws Exception
         Writer out = new FileWriter("Foo.java");
         out.write("public class Foo implements Runnable {\n");
         out.write("    public void run() {\n");
         out.write("        System.out.println(\"run like the wind\");\n");
         out.write("    }\n");
         out.write("}\n");
         out.close();
         Runtime.getRuntime().exec("javac Foo.java").waitFor();
         ((Runnable) Class.forName("Foo").newInstance()).run();
    }

  • War file doesn't take new classes

    Not sure if this is right place to ask this question, but please help.
    I had a war file deployed to weblogic 8 server, and I want to fix a problem quickly so I exploded the war file and put new classes files in /WEB-INF/classess directory. After I re-deploy this new war file, it still take the old version of classes file from somewhere I don't know.
    Please help, I think this is short-cut to fix application but it turns to take even longer.

    Not sure if you are stalled by a firewall or security in your web application or other mishap. Can you take a look at the relevant log at the server site? Look at the .log files at j2ee/home/log/. From *-web-access.log, you can determine if your url request indeed hit your server. From application-deployments/<youApp>/application.log, you would see the relevant exception.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to access or create a stage in a class file

    Hello Flash Actionscript writers,
    I have recently discovered that I cannot use the "stage" in a
    class file. I had a regular fla file that had actionscript
    in my "actions" layer. Of course, the fla has a stage object.
    I decided it might be nice to use the actionscript
    I wrote (copied, stole, etc) in as a class, so I could use it
    in different places, etc. I am still a neophyte in this area.
    My new class file consists of a button and a textfield. I
    created small classes for each of these items as an exercise for
    myself on creating a simple class, etc.
    I also have a URLLoader, and use an xmllist to do a sort of
    mini-slide show. The idea is to show a button and the textfield.
    When the user clicks the button the slide show starts. I would like
    to be able to center the images loaded on the stage, along with the
    buttons, etc. Right now I am cheating - since I decided the stage
    is 500 px wide, etc. I can use 500 - myButton.width, etc to center
    items. The fla where the class is called has a stage that wide,
    etc. The swf created from the class file WeeklySlideShow.swf is
    created from a fla with the DocumentClass set to my class
    WeeklySlideShow.as.
    I then have yet another fla file, and load my
    WeeklySlideShow.swf into that file, and play it, etc. But my
    buttons and images are not centered. Or should I just put my
    actionscript class back into the calling fla as an actions layer,
    thus having a stage where I can center everything. I probably have
    a flaw in the items in my class file and am really miss-using the
    class concept, etc.
    Any tips will help.
    Thanks,
    eholz1

    A little more text explaining where you get stuck might help (tell us which wires you can figure out, and which ones you can't).
    Anyway, if you never want this VI to give you a dialog, simply wire a FALSE constant to 'Advisory dialog?'.
    If you wire TRUE to it, or leave it unwired, LV will give you a dialog if you want to open a file (specified by 'file path') and it does NOT exist, or if you want to create/replace a file and it DOES exist.
    The file you actually want to open/create/replace is specified by the 'file path' input. If this is empty, LV will also show a dialog.
    I am not sure what happens if you leave the 'file path' empty, and wire FALSE to 'Advisory dialog?', but that's easy to test.
    In your case, to avoid a dialog always, make sure the 'file path' is
    never empty and the 'Advisory dialog?' is wired to a FALSE constant.

  • *Added* code to existing source file, compiled it, and class file shrunk

    Another newbie here. Fortunately, my classpath is ok, so I'm able to compile a .java file.
    I added one line of code (System.out.println) to write the value of a variable to a log. After compiling with javac, I noticed that the resulting [new] class file was smaller than the existing class file. I looked at each of the class files with Textpad. It's gibberish, but I quickly saw that a large block of code was missing in the new class file, even though the size of the source file had been increased.
    There is a difference, however, between how the two class files were created. The existing class file was compiled (along with many others) by exporting an .EAR file from a development environment (WSAD) to the WebSphere Administrator Console. Conversely, I am now compiling the same source file with javac on my machine.
    I suspect that this is the reason why I can add code to a .java file, compile it, and have the resulting class file actually lose code. Even if I am correct, I don't know what to do about it.
    Does anyone have an idea?
    Regards,
    Daniel T.

    Thank you both for your replies. I've read many posts over the past few months, and I know how important it is to provide as much info as possible, when asking a question here. That said, I have another tasty tidbit...
    After replacing the existing (larger) class file with the new (smaller) class file, my application now produces this:
    "*Error 500: LinkageError while defining class*..." [name of class]
    *"...(Unsupported major.minor version 50.0) This is often caused by having a class defined at multiple locations within the classloader hierarchy. Other potential causes include compiling against an older or newer version of the class that has an incompatible method signature. Dumping the current context classloader hierarchy: ==> indicates defining classloader ==>[0] com.ibm.ws.classloader.CompoundClassLoader@6bd156d5 Local ClassPath:"*
    ...[the entire classpath]...
    Original exception--- java.lang.UnsupportedClassVersionError:
    I'm guessing that my focus should mostly be on the 'Original exception', and maybe I need to revisit the JRE or JDK or JVM (these terms are somewhat nebulous to me, so please forgive me using them interchangeably) on my machine. For now, I'll just keep trying stuff. Thanks again for the replies!
    Regards,
    Daniel T.

  • Dynamically reloading recompiled class files

    How can I configure standalone OC4J to automatically reload class files compiled to WEB-INF/classes without restarting the server? I have tried different settings in orion-web.xml (development="true", added classpath, search-local-classes-first="true") but nothing seems to work.

    I think this bug (3473628) has to do with something different than what I am referring to. It deals with JSP files located under WEB-INF not compiling (which is a non-standard location for JSP files anyway).
    The behavior I am looking for is: if I change a Java source class (e.g., a bean class) and recompile it to WEB-INF/classes, I want the server (OC4J) to notice that a new .class file for my bean now exists, unload the existing class file, and load the new one into the VM, without restarting.

  • Deploying the extended controller class file on server

    Hi OAF Experts,
    I am working on the already extended controller file.
    I have made the changes and was able to comiple the controller class file.
    I have one uestion for you. Now to put the class file on the server i am following the below steps:
    1) Putting the new class file on the server where it is already present. This is done using Unix commands
    2) Bouncing the server.
    I hope this will reflect the new changes. Is there any thing else i need to do?
    Thanks,
    Samarth

    Hi,
    Yes. These are only required steps to reflect the changes.
    --Sushant                                                                                                                                                                                   

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • Updated Class files not generated

    Hi ,
    I am using Eclipse SDK Version: 3.2.2 and have configured with my project and weblogic server. When the application is running in debug mode if necessary making some fix and when i use ctrl+b the new class file should be generated and immediately the application should refer to the new class file without expecting to restart the weblogic server.
    But that's not happening, when i do a ctrl+b the class files are cleaned and new class files are not getting generated,moreover this cleaning is also consuming lot of time.
    Can some body help me to resolve this , so that i can save lot of time in restarting the server for every small fix too.
    Regards
    Sathya

    Hi ,
    I am using Eclipse SDK Version: 3.2.2 and have configured with my project and weblogic server. When the application is running in debug mode if necessary making some fix and when i use ctrl+b the new class file should be generated and immediately the application should refer to the new class file without expecting to restart the weblogic server.
    But that's not happening, when i do a ctrl+b the class files are cleaned and new class files are not getting generated,moreover this cleaning is also consuming lot of time.
    Can some body help me to resolve this , so that i can save lot of time in restarting the server for every small fix too.
    Regards
    Sathya

  • Overwrite class files

    Hi all;
    I have a question about the class files. Let's say that I have some errors when I compile the code. I make the corrections and recompile the code again. However, for some reason the new class files are not overwriting the previous ones.
    Therefore every time I compile the code I have to go to the file manager and delete the old class files.
    I am sure this a very basic problem. Has anybody got an idea. Is is because of the class path?
    Thanks in advance

    Thats queer... if the class is an applet then it could be that the JVM has not loaded the updated version. I know that when I make applets, I have to close all the internet windows usually to shut down the java plugin console and jvm. Then I recompile with my changes and then reload the applet, it's a slow process, but it works.
    In the case of a regualar Java program I'd suggest checking out settings in Windows, as javac.exe replaces without notice or conformation on its own. Or maybe the files are going somewhere else? Anyways, that sounds more like a Windows setting thing if it's doing it with an application.

  • Restart application or reload jar-file(class-files)

    hi,
    i write an update service for my application!everytime a update is available, the new jar-file(my application) will be downloaded and replace the old, running jar-file! now i want to restart my application to use not a mix of old and new class-files in the vm!
    is there any possibility for restarting my java vm or is there another way to "refresh the class-files in the vm"?
    thx mseele

    Hi,
    The easiest way is to terminate the jvm (using System.exit), and just have a loop in the script file that starts your application. In that way your application will be restarted when the jvm exits.
    To write a classloader of your own is another, but a lot harder way.
    /Kaj

  • How to reload class file for java objects in CF MX7

    I'm trying to create a simple java object for use in a CFML
    page. According to the topic "About ColdFusion and Java objects" in
    the CF developer's guide, I can compile my java module and put the
    .class file in the CFusionMX7/wwwroot/WEB-INF/classes directory and
    it'll be dynamically reloaded any time CF sees a new .class file
    there. But the dynamic reload isn't happening; I have to restart
    the CF server to get it to pick up a new version.
    I don't believe this directory is in the "general JVM
    classpath"; I don't find "classes" in the Java Class Path in the CF
    Administrator's System Information page. And I have all the caching
    options turned off on the "Server Settings > Caching" page, if
    that has any bearing on it.
    Are there any known issues around this dynamic reload
    capability, or maybe a more definitive way to make sure the
    WEB-INF/classes directory isn't in the classpath?
    Thanks,
    James

    Yes, I understand. But if I'm reading it correctly, what
    you're saying seems to contradict the documentation
    http://livedocs.adobe.com/coldfusion/7/htmldocs/00001561.htm
    ColdFusion dynamically loads classes that are either .class
    files in the web_root/WEB-INF/classes directory or in JAR files in
    the web_root/WEB-INF/lib directory. ColdFusion checks the time
    stamp on the file when it creates an object that is defined in
    either directory, even when the class is already in memory. If the
    file that contains the class is newer than the class in memory,
    ColdFusion loads the class from that directory.
    http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_18228&sliceId=1
    Dynamic class reloading for Java servlets classes and
    forcfobject (sic) Java classes is disabled by default in
    ColdFusion MX. To enable dynamic class reloading, do the following:
    Also, I seem to recall that setting worked in a prior
    version. Though I would have to test it again on another machine to
    be certain.

  • Is there any way to force jvm load a new class?

    I write a standalone command line program. This program calls a function which I added to an existing class. the existing class has run run for a while by other processes.
    When I run my command line program, it can not find the function I added to the existing class. But I am 100% sure I have overwrote the existing class file with my new copy. It looks like the old class file is still in effect.
    How can I instruct the JVM to load my new class file, not using the old one(maybe it is cached in memory, and didn't get refreshed)
    Welcome any suggestions. I have run out of idea. (BTW: It is infeasible for me to restart the computer)

    Classes are loaded by an object called a ClassLoader which stores all the classes it loads in some kind of internal Map object. If you ask the same ClassLoader for a class it's already loaded it will given you the old one.
    The only way to drop a class is to drop the ClassLoader which loaded it and create a new one to load a new version.
    What you need to do is to put the class file in question is a directory or jar which isn't on the class path. And make sure that no class file of the same name exists on the classpath (because that will be loaded in preference).
    Then you create a java.net.URLClassLoader pointing to the directory or jar (use FIle.toURL() to turn a file into a URL).
    Then call loadClass on that to load your class file. Then you'll probably have to call newInstance() on the class object to create an instance.
    Of course, if new method signatures are added you'll have to access them using Method objects, since they won't be know about at compile time.

Maybe you are looking for

  • Need  to send mail  thro procedure

    Hi , I need to send a mail when a procedure fails .I was trying to use utl_smtp package . i just took a sample code available and was trying to work with it as thi s is first time iam using this package .iam getting a error ora-29278.Could u please t

  • Data from iOS app

    Hello, I'll extract data saved from an iOS app; the iPad isn't connected. I can save data to preference file and it's work perfectly. But after that how can I extract this file from the local iPad? Can I write to an USB key connected with the Apple a

  • My new Photoshop CS4 doesn't have 'Picture Package'...?

    I go to File > automate and Picture Package is not in the pop up menu. I can't access it from Bridge either Tools > Photoshop...Photoshop help says it is still a feature in CS4. What step am I missing? a bug?

  • Calendar appointments not being sent

    Hi, I am having an issue with our exchange server, Exchange 2010.  This issue just started happening out of the blue, Up to now everything was working properly. We have a resource room mailbox established for a conference room (This is set up as a st

  • Archive Utility problem

    Hello I am having a problem with compressing files when I right click and try to compress (zip) files. An error messages comes up that says "the contents list cannot be created for compressing." It works again if I restart, but it stops working again