Can't run java .class programs from Windows command line!

I have tried to get a program that I wrote with the JDK to run from the Windows command line, but it is not working. I typed:
java HelloWorld
Where my .class was HelloWorld.class, a compiled java program. I spelled the name correctly (and I am in the correct directory), yet I get the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld
I think something is screwy with windows, but that's just me. Any ideas??

Likely a CLASSPATH issue - try
java -classpath . HelloWorldGood Luck
Lee

Similar Messages

  • Run Scripts from windows command line

    Hi, We're creating a test enviroment and we need to "rebuild" our Database (Tablespace) from scratch everytime we run a test.
    What we need is to run all scripts files from windows command line, there is any command or application we can use here?
    thanks.
    Fernando.

    Create a scripts.bat file with something like this in it:
    @sqlplus -S username/password@connect @scriptname.sql

  • Testing Java Concurrent Program on the command line in Windows

    I'm using the suggestions in:
    http://blogs.oracle.com/xmlpublisher/2007/05/02
    to test my Java concurrent program on the command line. Our production environment is running on Unix. I've been able to test it successfully on the Unix environment from the command line. However, it fails when I try to test it on the Windows command line with the following stack trace:
    Exception in static block of jtf.cache.CacheManager. Stack trace is: oracle.apps
    .jtf.base.resources.FrameworkException: IAS Cache initialization failed
    at oracle.apps.jtf.cache.IASCacheProvider.init(IASCacheProvider.java:225
    at oracle.apps.jtf.cache.CacheManager.activateCache(CacheManager.java:14
    44)
    at oracle.apps.jtf.cache.CacheManager.initCache(CacheManager.java:752)
    at oracle.apps.jtf.cache.CacheManager.<clinit>(CacheManager.java:378)
    at oracle.apps.fnd.cache.Cache.setCacheFullName(Cache.java:228)
    at oracle.apps.fnd.cache.Cache.initCache(Cache.java:114)
    at oracle.apps.fnd.cache.Cache.<init>(Cache.java:89)
    at oracle.apps.fnd.cache.AppsCache.<init>(AppsCache.java:86)
    at oracle.apps.fnd.cache.AolCaches.getCache(AolCaches.java:155)
    at oracle.apps.fnd.profiles.Profiles.<clinit>(Profiles.java:241)
    at oracle.apps.fnd.profiles.ExtendedProfileStore.init(ExtendedProfileSto
    re.java:498)
    at oracle.apps.fnd.profiles.ExtendedProfileStore.<init>(ExtendedProfileS
    tore.java:119)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
    orAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
    onstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
    at oracle.apps.fnd.common.AppsContext.instantiateProfileStore(AppsContex
    t.java:4312)
    at oracle.apps.fnd.common.AppsContext.makeProfileStore(AppsContext.java:
    1171)
    at oracle.apps.fnd.common.Context.setProfileStore(Context.java:970)
    at oracle.apps.fnd.common.Context.setProfileStore(Context.java:952)
    at oracle.apps.fnd.common.AppsContext.initializeContext(AppsContext.java
    :958)
    at oracle.apps.fnd.common.AppsContext.initializeContext(AppsContext.java
    :918)
    at oracle.apps.fnd.common.AppsContext.<init>(AppsContext.java:752)
    at oracle.apps.fnd.cp.request.CpContext.<init>(CpContext.java:141)
    at oracle.apps.fnd.cp.request.CpContext.<init>(CpContext.java:124)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:127)
    Caused by: oracle.apps.jtf.base.resources.FrameworkException: null
    null
    CacheDefaultConfig.properties (The system cannot find the file specified)
    at oracle.apps.jtf.base.resources.FrameworkException.convertException(Fr
    ameworkException.java:607)
    at oracle.apps.jtf.base.resources.FrameworkException.addException(Framew
    orkException.java:585)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:66)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:88)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:202)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:218)
    at oracle.apps.jtf.base.resources.FrameworkException.<init>(FrameworkExc
    eption.java:249)
    ... 26 more
    Exception in thread "main" oracle.adf.mds.exception.MDSRuntimeException: Cache n
    ot initialized
    at oracle.apps.fnd.framework.mds.cache.ATGCacheMgrDelegateImpl.<init>(AT
    GCacheMgrDelegateImpl.java:325)
    at oracle.apps.fnd.framework.mds.cache.ATGCacheFactoryImpl.<init>(ATGCac
    heFactoryImpl.java:44)
    at oracle.apps.fnd.cp.request.CpContext.getMDSContext(CpContext.java:116
    9)
    at oracle.apps.fnd.cp.request.Run.main(Run.java:130)
    I've put the appsborg2.zip file in my classpath. I've also copied the entire (1 GB) worth of Java .class files for Oracle apps onto my computer and placed it on my classpath. Is there something that prevents me from testing out my Java concurrent program on my Windows machine from the command line?

    i think if u run the ap in the command line then it has to stay open, you could try writing a .bat file then when that is executed it will only open the command line for the program execution (i think)

  • How to check system status from Windows command line?

    Does anyone has an idea how to check system status from Windows command line? In UNIX we use startsap check, unfortunately I didn't find an appropriate command provided by SAP.
    The only idea we have is to use
    tasklist /FI "Username eq SAPService<SID>" | find "disp+work"
    which isn't as nice as startsap check.

    Hi,
    In windows you can use the command
    go to profile directory in command prompt and the give the following command to check the status of the instance.
    sapstart check pf=START_DVEBMGS<nr>_<hostname>
    that means you need to mention start profile or instance profile. So that it will say whether the instance is running or not.
    If you want any other information please reply back to me.
    Thanks,
    Chaitanya.

  • How can I run an external program from a PLSQL procedure?

    Is there a package to run an external program from PLSQL? or is there another way to do that?
    thanks.

    here there is an example about how a PL/SQL procedure can
    work with an external C program.
    http://download-east.oracle.com/docs/cd/A87860_01/doc/appdev.817/a76936/dbms_pi2.htm#1003384
    Apart from that you have Java Stored Procedures option
    to carry out your task.
    Java Stored Procedures Developer's Guide Contents / Search / Index / PDF
    http://download-east.oracle.com/docs/cd/B10501_01/java.920/a96659.pdf
    Joel P�rez

  • Help required - running a Java program from the command line

    Hi,
    I have a small non-graphical Java application, packaged into a Jar file. My program relies on classes in another (external) Jar file.
    When I run the application from the IDE, everything works fine. However, when I try to run the application from the command line, I keep getting a NoClassDefFoundError for classes in the external jar.
    Both the application jar file and the external jar file are in my root directory (C:\).
    My command line call is as follows:
    java -cp c:MyExternalLib.jar -jar MyApp.jar
    Any help greatly appreciated.
    Thanks,
    Walter

    hi,
    set classpath=%classpath%;c:\myjar.jar;
    here i have specified myjar.jar file as an example u give ur location.after setting the classpath run ur java application.
    java mypgm
    this will solve ur problem
    regards,
    Ganesh

  • Problem with running a java program from the command line

    I have this code:
    package pkg;
    import jxl.*;
    import java.io.File;
    public class TestClass {
         public static void main(String[] args) {
              try{
                   Workbook book = Workbook.getWorkbook(new File("d:/testWorkspace/excFile.xls"));
                   Sheet sheet = book.getSheet(0);
                   String s=sheet.getCell(4, 2).getContents();
                   System.out.println(s);     
              }catch (Exception e){System.err.println(e);}
    }I've wrote it in Eclipse, added jxl.jar to the buildpath, and it works fine.
    Then I tried to run it from the command line and I did it like this:
    D:\testWorkspace\testProject\bin> java -cp \jxl.jar pkg.TestClassThe result was:
    Exception in thread "main" java.lang.NoClassDefFoundError: pkg/TestClass
    Caused by: java.lang.ClassNotFoundException: pkg.TestClass
    ...but the file TestClass.class DOES exist in the folder d:\testWorkspace\testProject\bin\pkg\ and the file jxl.jar IS on the root of drive D (like I already wrote, it worked fine inside the Eclipse).
    So, my question is: How to run this code from the command line?
    I have no idea what went wrong.
    Can someone help me, please?

    The current directory is not implied in the classpath.
    D:\testWorkspace\testProject\bin> java -cp .;d:\ pkg.TestClassor
    D:\testWorkspace\testProject\bin> java -cp .;d:\jxl.jar pkg.TestClassI always forget which is right since I never work with jars...

  • How can i run Java class form  other java application.

    Hi ,
    I have problem to run java class from my java application,
    I am using the class ClassLoader in order to launched the Java class , it�s work fine whenever, the class exist in the same folder , however , when i am trying to run class that is not in the current folder ,
    i got error (see below),
    Do you have any idea what is wrong?
    java.lang.ClassNotFoundException
         at SimpleClassLoader.loadClass(SimpleClassLoader.java:110)
         at SimpleClassLoader.loadClass(SimpleClassLoader.java:53)
         at Run.main(Run.java:31)

    What does "run an class" mean? You don't run classes. They're not executables.
    I bet your problem is the classpath. You are aware that the classloader looks only there? Unless it's an UrlClassLoader.

  • Running powewrpc programs from the command line

    I am trying to run a powerpc application (quicken) from the command line. I want to log into the mac over my local network and run a powerpc program, but I get the following when I try it:
    cannot execute binary file
    I am logging in via ssh, and am running the X11 package from a different unix system which also runs X11.
    How do I get the application to execute? (it runs fine from the desktop).

    I am sitting at a Sun Solaris machine (it runs X11R6
    and Matif). I want to run Quicken, which is on the
    mac mini. I log into the mac with ssh -X. I find the
    Quicken program, but the permissions are set to 644
    (read, but not execute). If I change the permissions
    and try to run the program I get teh error message
    "cannot execute binary file".
    The window interface of the Mac is not X11: so you cannot output it on another X system. Is is not like connecting to another Un*x system.
    Said that, you should be able to launch a program, but you cannot see the output. However, usually Macosx applications are bundles with some executable inside, not directly an executable file: .app files are folders, not files. In order to launch such kind of apps, you have to use the open command I suggested in the previous post.
    I have no idea what VNC is. If this is how I can do
    this, then please provide me a link to it.
    VNC is a screen sharing application, just like Windows Remote Desktop. You may install a VNC server on your mac mini, and then connecting with a VNC client you will see all your computer screen as if you were there. It is cross platform, so no matter which is your client (including mobile phones).

  • Please help: Running a java script form the windows command line.

    Hello forum,
    I'm trying to run a java script from the command line on
    windows but I always get the "Failed to open document" alert.
    I typed the following in the run command line:
    "flash.exe" C:\Documents and Settings\Hasan.Atieh\My
    Documents\science\java scripts\testing jsfl\get_files_mx2004.jsfl
    now I copied and pasted the path of my java script file from
    the windows explorer address bar so I'm sure that the java script
    file exists in the specified path.
    Any thoughts why am I getting the message!!

    :oops: never mind... issue resolved. I didn't quote the java
    script file path but thats because the help documents on flash
    didn't say that.
    this is what flash help say:
    To run a script from the command line on Windows:
    Use the following syntax (add path information as required):
    "flash.exe" myTestFile.jsfl

  • Can't send files to Trash from the command line

    Hello,
    as I'm programming in JAVA I must do all "special" operations as from the command line.
    I found several solutions but they don't work for me, at least not in Mavericks.
    I tried:
    osascript -e "tell app \"Finder\" to delete POSIX file \"/Users/me/totrash\""
    I got:
    21:60: execution error: Finder got an error: Handler can’t handle objects of this class. (-10010)
    I tried:
    echo "tell application \"Finder\" move POSIX file \"/Users/me/totrash\" to trash end tell | osascript
    I got:
    26:30: syntax error: Expected end of line but found command name. (-2741)
    Is there any working AppleScript way to send a file to the Trash Bin?
    Thanks in advance.
    ;JOOP!

    Near ....... I did not misspell 'me', I was in a different directory after all my experimenting .....
    Curse those who write cryptic error messages ...
    Bless those who still get it.
    So, thanks.
    ;JOOP!

  • How can I package an HTML5 panel from the command line?

    I am able to use the Eclipse Extension Builder plugin to export a ZXP file, but for our build process we will need to do this from the command line.  Is this possible?

    Edit: Adobe has fixed the links and the downloads are now available.
    The links to the Windows downloads do not seem to be active anymore.  Is there somewhere else we can get these?
    http://labs.adobe.com/downloads/extensionbuilder3.html

  • Can't run java or javac from dos prompt

    I just installed j2sdk1.4.1 on win98SE. I have a problem where I can't seem to be able to compile or run an application from the dos prompt. I can do both in Visualage for Java or in JGrasp but not at the DOS Prompt. I have set the PATH statement to PATH=c:\j2dsk1.4.1\bin and the classpath=c:\j2sdk1.4.1\lib. The following is a typical error message:
    javac RunApplet.java
    RunApplet.java:8: cannot resolve symbol
    symbol : class MyApplet
    location: class RunApplet
    MyApplet myApplet = new MyApplet():
    RunApplet..java:8: cannot resolve symbol
    symbol : class MyApplet
    location: class RunApplet
    MyApplet myApplet = new MyApplet()
    2 errors
    java RunApplet.class
    Exception in thread "main" java.lang.NoClassDefFoundError: RunApplet/class
    It seems like the system can't locate the class files?
    Also is there away to use more than the standard 8.3 charecter set in the DOS prompt window?
    TIA

    javac RunApplet.java
    RunApplet.java:8: cannot resolve symbol
    symbol : class MyApplet
    location: class RunApplet
    MyApplet myApplet = new MyApplet():
    RunApplet..java:8: cannot resolve symbol
    symbol : class MyApplet
    location: class RunApplet
    MyApplet myApplet = new MyApplet()
    2 errorsMost likely a Classpath problem. I suggest changing your classpath to:
    classpath=.;c:\j2sdk1.4.1\lib
    java RunApplet.class
    Exception in thread "main"
    java.lang.NoClassDefFoundError: RunApplet/class2 problems. As ChuckBing says, the command needs to be "java RunApplet" with no .class. The argument to the java command is the class name, not a file name. The second problem - if you do not have a successful compilation, there won't be any .class file to run.

  • How to run a class file from windows ?

    hi, i have created a shorcut to run my java application from my windows desktop, but i have the error message "Couldn't find the main class, programm will exit",
    the shortcut is as follow
    [%windir%\System32\javaw.exe C:\ProgramFiles\\Main]
    thanks for you help,

    Im new to running java from a shortcut but this may help. I hope this helps.
    this is the command you ned to write and refer to my example;
    javaw.exe -cp <path to class file> packageName.className
    This is an example of wat i have typed to run my program from a shortcut;
    C:\JBuilder3\java\bin\javaw.exe -cp C:\jbuilder3\myclasses\welcome.jar welcome.welcome
    Hope this helps
    good luck!!!
    Matx3001

  • Trying to run java class files from my jsp

    I am having difficulty running java files from my jsp. I have compiled my two java classes and inserted them onto my server in the webapps/WEB-INF/classes/scripting directory and have imported scripting.* into my jsp page. The files both compiled ok before the class files were loaded onto the server but when I rty to run the jsp from the server, I keep getting a compiler error. Thanks in advance
    Iob

    Here are the few question
    1) Does your java classes which u created is declared under package scripting. *.class files are to be places under the WEB-INF/classes directory only. Not under scripting. But if you java classes say are under a package called a.b. Then you need to put under classes\a\b\.

Maybe you are looking for