Executing compiled file under windows

Hi there,
i got the following problem:
i installed the jdk 1.5.0_06 on windows xp
i did set environmental variables (Path, JAVA_HOME)
i compiled a simple HelloWorld.java program
no problems there, result was HelloWorld.class
but when i want to start the whole thing the only thing i get is an exception.
i tried:
java HelloWorld.class
java HelloWorld
both tries resulted in:
"Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld"
i looked the exception up on java site, which brought me following result:
"public class NoClassDefFoundError
extends LinkageError
Thrown if the Java Virtual Machine or a ClassLoader instance tries to load in the definition of a class (as part of a normal method call or as part of creating a new instance using the new expression) and no definition of the class could be found.
The searched-for class definition existed when the currently executing class was compiled, but the definition can no longer be found. "
now im pretty new to java programing and wouldnt call myself a pro c/c++ programer either... so i dont have any clue what the problem is about the whole thing. would be very thankful for any hints.
i add the java code of the helloworld program, maybe its helpful...:
thnx in advance
public class HelloWorld /* extends object */ {
     public static void main(String[] args) {
          System.out.println("Hello World!");
          int a, b, c;
          a = 17;
          b = 21;
          c= (a*a)+(b*b);
          for (int i=0; i<10; i++)
               System.out.println(i);
     } //main
} // HelloWorld

Simple classpath issue. Research what the "classpath" is for. In the meantime, this simple example would be fixed like this:
java -classpath . HelloWorld

Similar Messages

  • Problems compiling KVM under windows

    Hi there,
    We tried to compile KVM under windows platforms and failed.
    Compilation failed at the java files under j2me_cldc\tools\jcc
    Therefore we do not have: nativeFunctionTableWin.c and nativeRelocationWin.c
    Can you please help us to compile the java files or send us the *.c files.
    Thanks
    Ronny Sherer.
    mailto:[email protected]

    I had the same trouble and this is what I did to get the KVM to compile.
    1. First of all to compile under windows you need a the Visual Basic Compiler and Linker to compile the C files.
    Also, in order for the makefiles to work properly, you need to install cygwin with basic command line functions (make,find,pwd...). And you need to place the cygwin commands ahead of the windows commands in your PATH eg set PATH = C:\cygwin;C:\windows.
    2. COPY the classes dir in j2me_cldc\bin\common\api
    TO the j2me_cldc\api dir
    3. Then modify the makefiles - where it has $(JAVAC) imediately after it type -target 1.1
    so for example in j2me_cldc\api\makefile the line
    $(JAVAC) -g$(DEBUGFLAG) -d tmpclasses -bootclasspath classes \
    becomes
    $(JAVAC) -g$(DEBUGFLAG) -target 1.1 -d tmpclasses -bootclasspath classes \
    NOTE: nowhere did I find anything to suggest that the KVM must be compiled under Java 1.1 but this is what worked for me.

  • Command to generate an executable report file in Windows XP 5.1.2600

    Is it possible to generate an executable report file in Window XP 5.1.2600 using the windows command line? If it is possible what is the command? The report is created in oracle reports builder 6.0.8.11.3 version. Thanks.

    rwcon60 userid=username/password@dbname batch=yes source=reports.rdf stype=rdffile dtype=repfile

  • Can not create a file under \window\system32 folder

    How do I create a folder in \windows\system32 in x64 machine through java code?
    Creating a file/folder under \windows\system32 fails and java creates a folder in \windows\syswow64 folder.
    pls see the code attached for example.
    My client wants to create a folder using my application.
    I dont want to use any native code suggested by microsoft. You can see in the following link
    http://msdn2.microsoft.com/en-us/library/aa365743(VS.85).aspx
    import java.io.*;
    public class FileTest{
         FileTest(){
              boolean created = writeFile();
              if (created)
                   System.out.println("File Created Successfully");
              else
                   System.out.println("Could not able to create the file");
         public static void main (String args[]){
              FileTest ft = new FileTest();
         public boolean writeFile(){
              try{
              Writer output = null;
              String text = "Sample Test File";
              if(!(new File("c:\\windows\\system32\\customFIle").exists())){
                   new File("c:\\windows\\system32\\customFIle").mkdirs();
              File file = new File("c:\\windows\\system32\\customFIle\\write.txt");
              output = new BufferedWriter(new FileWriter(file));
              output.write(text);
              output.close();
              return true;
              }catch(IOException ioex){
                   System.out.println(ioex);
              return false;
    Thanks in advance

    java_mani wrote:
    How do I create a folder in \windows\system32 in x64 machine through java code?Can the user that executes this Java code create "manually" a folder in that directory?
    Creating a file/folder under \windows\system32 fails and java creates a folder in \windows\syswow64 folder.
    pls see the code attached for example.
    My client wants to create a folder using my application.
    I dont want to use any native code suggested by microsoft. You can see in the following link
    http://msdn2.microsoft.com/en-us/library/aa365743(VS.85).aspx
    Why not?

  • DSC powershell xwindowsprocess to execute batch file under different user account

    DSC powershell run under "NT AUTHORITY\SYSTEM".
    I am trying to execute a batch file under different user account using xwindowsprocess in DSC resource kit.
    I created a custom dsc resource with 3 parameters namely Exepath, Arguments, Credential.
    I received those parameter values in settargetresource method.
    CallPInvoke
    [Source.NativeMethods]::CreateProcessAsUser(("$ExePath "+$Arguments), $Credential.GetNetworkCredential().Domain, $Credential.GetNetworkCredential().UserName, $Credential.GetNetworkCredential().Password)
    I tested it by invoking a batch file and writing username under which it executes to a text file.
    After executing, the output text file still contains the "Systemname$".

    Configuration Sample_xService_ServiceWithCredential
    param
    [string[]]
    $nodeName = 'localhost',
    [System.String]
    $Name,
    [System.String]
    [ValidateSet("Automatic", "Manual", "Disabled")]
    $StartupType="Automatic",
    [System.String]
    [ValidateSet("LocalSystem", "LocalService", "NetworkService")]
    $BuiltInAccount="LocalSystem",
    [System.Management.Automation.PSCredential]
    $Credential,
    [System.String]
    [ValidateSet("Running", "Stopped")]
    $State="Running",
    [System.String]
    [ValidateSet("Present", "Absent")]
    $Ensure="Present",
    [System.String]
    $Path,
    [System.String]
    $DisplayName,
    [System.String]
    $Description,
    [System.String[]]
    $Dependencies
    Import-DscResource -Name MSFT_xServiceResource -ModuleName xPSDesiredStateConfiguration
    Node $nodeName
    xService service
    Name = $Name
    DisplayName = $DisplayName
    Ensure = $Ensure
    Path = $Path
    StartupType = $StartupType
    Credential = $credential
    $Config = @{
    Allnodes = @(
    Nodename = "localhost"
    PSDSCAllowPlainTextPassword = $true
    #Sample Scenarios
    $credential = Get-Credential
    Sample_xService_ServiceWithCredential -ConfigurationData $Config -Name "Sample Service" -DisplayName "Sample Display Name" -Ensure "Present" -Path "C:\DSC\TestService.exe" -StartupType Automatic -Credential $credential
    ¯\_(ツ)_/¯

  • Providing users the ability to Merge using a DAT file under Windows 7

    Hello,
    Our organization uses older software that uses Word Templates with Merge Fields, pulling data out of a SQL database.  The software itself is old and out of date, but still works under Windows 7.  The problem I am having is that the software will
    place its own macros inside of Normal.dot to properly merge fields using the Word Templates.
    Each Merge document accesses the application folder and goes into a sub-folder to access a file called WORDDATA.DAT that is the data source for the merge.  Each workstation has their own WORDDATA.DAT file stored locally in C:\APPLICATION\temp\
    In XP (we never used Vista), the proper way to get these merges to work was to do the following:
    1. Provide Power Users (see below) with Modify rights to the main APPLICATION folder and propagate those rights down to all files underneath of it (including WORDDATA.DAT).  We also had to remove inheritable permissions from the root drive (C).
    2. Add Domain Users to Power Users group (for some reason the merges on XP would not work without this) so that anyone logging onto the machine could merge.
    3. These templates required the Low security setting for macros in Word for the merge to work properly.
    The problem I am facing now is that I cannot get the merges to work properly under Windows 7 Pro without giving the user Administrator rights on the local machine.  This is obviously not a good idea.  No matter what I try, nothing seems to work. 
    I've disabled UAC on these machines.  Given Full Control rights to the application folder and all sub-folders and have even gone so far as to make the user the Owner of the application folder.  But no matter what I do, the merge will not work unless
    the user is added to the local Administrators group.  I've also noticed strange behavior with WORDDATA.DAT, where it will not relinquish the Read-Only attribute.  After running 'attrib' and stripping it of Read-Only and System attributes, the file
    reverts to showing Read-Only in the properties.  I don't know if this matters or not, but it appears as if Windows will not let anyone modify that file completely.
    Does anyone have a suggestion for a workaround?  Keep in mind, 1. Disabled UAC, 2. Running the application under Compatibility Mode for XP.
    I realize we are using outdated software and this can cause some issues of course, but the basic principle of merging documents works.  It has nothing to do with the application itself IMO but seems to be more of a security issue.

    I guess I'm completely out of luck on this issue huh?  The basics of the problem are simply that unless the user is added to Administrator local group on the Win7 machine, when the merge runs and has to use WORDDATA.DAT, it cannot and the merge fails. 
    Add the user as an admin and it works but this leaves our systems vulnerable, particularly with users who are happy to just double-click on any old attachment without checking it first.

  • FAQ: Fix for Problem Printing PostScript "to file" Under Windows 2000

    PROBLEM
    A number of Acrobat users under Windows 2000 have reported a problem in which printing via the PostScript driver fails when printing "to file" instead of to a standard printer port (such an LPT, USB, TCP/IP port, or even Acrobat's internal port). Printing "to file" refers to the ability to check an option in programs such as FrameMaker or Microsoft Word that causes the PostScript that would have gone to a "real" printer port, to go to a specified file name, prompted for by the driver or application itself. The symptom of the failure may be either (1) no file produced and/or (2) a nondescript error message about "unable to print."
    Although we have not yet heard of this problem occurring under Windows XP, we have no reason to believe it couldn't given the extreme similarity in architecture and software components. If you are seeing this with Windows XP, please advise me of this via email and simply substitute "Windows XP" for "Windows 2000" for your purposes in this posting.
    CAUSE
    The problem is caused by a missing printing port named "FILE:" used by the driver whenever it, guess what, prints "to file." This port is automatically created when Windows 2000 is installed and normally would never disappear. What seems to be happening, based upon reports that I have received from several end users, is that under some conditions yet unidentified, uninstalling one version of Acrobat in preparation for installation of another (newer) version of Acrobat causes the "FILE:" port to be deleted from the system. This printing port deletion does not appear to be caused by any end-user error.
    Adobe's Acrobat Quality Assurance group has been alerted to the problem, but to date has been unable to internally reproduce the problem. We would appreciate any information from any user who encounters this problem in terms of exactly how the Acrobat Distiller printer instance was being used prior to an uninstall of Acrobat (for example, were you printing a FrameMaker book "to file" with the
    Acrobat Distiller printer instance for purposes of subsequently distilling the whole book manually?)
    FIX
    Fortunately, it is very easy to add the "FILE:" port back into the operating system:
    (1) Logon to Windows 2000 as a user with Administrator privileges.
    (2) Go to Start=>Settings=>Printers.
    (3) Select File=>Server Properties.
    (4) Click the "Ports" tab.
    (5) Click "Add Port".
    (6) Select "Local Port" and click "New Port".
    (7) In response to "Enter a port name:" respond "FILE:" (without the surrounding quote marks, of course) and click OK.
    (8) The "FILE:" port should now be in the list of available ports. You may close the remaining dialogs.
    At this point, printing "to file" should work correctly. Most likely, you will not see the problem reoccur unless you do another round of uninstalls of Acrobat.
    - Dov

    You need to download and install the ADPDF9.PPD printer description and use it instead of Device Independent.

  • README: Fix for Problem Printing PostScript "to file" Under Windows 2000

    PROBLEM
    A number of Acrobat users under Windows 2000 have reported a problem in which printing via the PostScript driver fails when printing "to file" instead of to a standard printer port (such an LPT, USB, TCP/IP port, or even Acrobat's internal port). Printing "to file" refers to the ability to check an option in programs such as FrameMaker or Microsoft Word that causes the PostScript that would have gone to a "real" printer port, to go to a specified file name, prompted for by the driver or application itself. The symptom of the failure may be either (1) no file produced and/or (2) a nondescript error message about "unable to print."
    Although we have not yet heard of this problem occurring under Windows XP, we have no reason to believe it couldn't given the extreme similarity in architecture and software components. If you are seeing this with Windows XP, please advise me of this via email and simply substitute "Windows XP" for "Windows 2000" for your purposes in this posting.
    CAUSE
    The problem is caused by a missing printing port named "FILE:" used by the driver whenever it, guess what, prints "to file." This port is automatically created when Windows 2000 is installed and normally would never disappear. What seems to be happening, based upon reports that I have received from several end users, is that under some conditions yet unidentified, uninstalling one version of Acrobat in preparation for installation of another (newer) version of Acrobat causes the "FILE:" port to be deleted from the system. This printing port deletion does not appear to be caused by any end-user error.
    Adobe's Acrobat Quality Assurance group has been alerted to the problem, but to date has been unable to internally reproduce the problem. We would appreciate any information from any user who encounters this problem in terms of exactly how the Acrobat Distiller printer instance was being used prior to an uninstall of Acrobat (for example, were you printing a FrameMaker book "to file" with the
    Acrobat Distiller printer instance for purposes of subsequently distilling the whole book manually?)
    FIX
    Fortunately, it is very easy to add the "FILE:" port back into the operating system:
    (1) Logon to Windows 2000 as a user with Administrator privileges.
    (2) Go to Start=>Settings=>Printers.
    (3) Select File=>Server Properties.
    (4) Click the "Ports" tab.
    (5) Click "Add Port".
    (6) Select "Local Port" and click "New Port".
    (7) In response to "Enter a port name:" respond "FILE:" (without the surrounding quote marks, of course) and click OK.
    (8) The "FILE:" port should now be in the list of available ports. You may close the remaining dialogs.
    At this point, printing "to file" should work correctly. Most likely, you will not see the problem reoccur unless you do another round of uninstalls of Acrobat.
    - Dov

    You need to download and install the ADPDF9.PPD printer description and use it instead of Device Independent.

  • Mounting CD/DVD image (*.ISO file) under Windows 7

    Does Encore, or any other prgram in the CS5 suite, have the ability to mount an ISO file as a CD or DVD under Windows 7?

    Here is one program, but I have never used it: http://download.cnet.com/Mount-ISO-Files-Virtually/3000-2169_4-10628996.html
    Good luck,
    Hunt

  • Burn a cpio file under windows xp?

    hi all
    i'm downloading oracle ias 10g r2 for unix. i saw that these are cpio files and i don't have a clue how i can burn them on a cd now under windows... i searched on google but didn't find much.
    thanks very much for help.
    josh

    Scroll down a bit on the Download page, and you'll see the following text:
    On UNIX:
    To extract the cpio file, move the cpio file to an empty directory, then do: cat filename.cpio | cpio -icd. To verify the integrity of a downloaded file, after the file has been transferred to a Unix host, run cksum and compare with the cksum information listed on this page.
    Regard,
    Martin

  • Executable vi files in windows!

    hi,
    Is it possible to compile my aplication to executable file, to use directly in windows, without use labview run time, or LW7?. I only get to join all the files in *.dll
    Can anybody tell me how?. I have labview 7.
    thanks, regards jose.

    > Yes, i want that my application run in other pc without install
    > labview runtime. I assure to you, this program run in all pcs without
    > install the lbrt or LV.
    >
    > Then, you say I only must to put the lbrt.dll in the directory. But
    > Where i get the file?. Also I think before I must to convert the file
    > dll(all my vis) to .exe, and i dont know, how can I pass from .dll
    > to exe?.
    There seems to be lots of confusion. LabVIEW VIs are not executables.
    They are compiled code, sort of like a DLL that can be executed within
    the LabVIEW environment, but not on their own.
    You can build LabVIEW VIs into an EXE using the Application Builder.
    This capability comes with the Professional edition and can be purchas
    ed
    separately.
    In order to keep the size of the executable smaller, the executable
    references the runtime DLL. The tool that build executables also builds
    installers that can automatically install the runtime if it is needed.
    If you build an EXE, the user can just double-click, they don't need to
    launch the runtime and load a VI.
    Greg McKasle

  • How to output executable Bin file under linux from java

    Hi
    im beginner in java under linux and i want to out put my java programs to be bin files that can run
    if this not possilble
    how to run the output jar files with just double click ?
    does i have to run sh file that do the hob how?
    thanks in advance.

    say your main method (application's entry point) is located in a class com.my.Class,
    then first you create a text file (say, manifest.txt) that contains this line:
    Main-Class: com.my.Class
    [/code}
    and then you append this to the jar's manifest as such:
    jar cfm yourjarfile.jar manifest.txt [additional files you might want to add]
    for more info,
    http://java.sun.com/docs/books/tutorial/deployment/jar/manifestindex.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Executing jar file in windows?

    Hi All,
    I have a jar file (built by Netbeans - if thats of any relevence) that I tried to run in windows, but I get the following error message:
    could not find main class, program will exit!Even though the manifest file in the jar does specify the main class.
    Main-Class: package.MyMainClassThe main class is valid and the jar works fine in linux.
    Does this have anything to do with the fact the manifest text file is in unix format? If not, does anyone one have any ideas whats wrong?
    Thanks!

    LeWalrus wrote:
    Yeah sorry, that's my fault for the confusion.
    in the OP i was just stating the general case, they weren't the actual names. Then I switched to giving the actual names. My bad!
    Basically, The main class specified by Main-Class in the manifest is the main class of the application. The jar file is the only thing referenced in the Class-Path!I don't think your jar file contains the main class or at least it is not in the correct directory. Expand the jar with the jar command (or winzip) to look at the content and make sure the class files are in directories consistent with the package.

  • How to execute sql files with windows path ?

    Hi , here's my stupid question :
    I have my parent SQL script say A.sql in directory C:\program files\my files\A.sql
    A.sql has calls to multiple sql files like this
    @@1.sql;
    @@2.sql;
    When I call A.sql using sqlplus as:
    sqlplus <username> <connection_string> @"C:\program files\my files\A.sql"
    A.sql gets executed but then while calling "1.sql" it fails with the error
    SP2-0310: unable to open file "C:\program.sql"
    This is happening because of the space, how can this be handled. thx in advance :)
    Regards,
    Neuron

    my A.sql is:
    @@1.sql
    @@2.sql
    1.sql and 2.sql are in the same directory as A.sql.
    sqlplus <username> <connection_string> @"C:\program files\my files\A.sql"
    VG2,
    Yes. Specify the entire path/filename and put double quotes around itA.sql has the double quotes around it, however what additional things can be done so that 1.sql and 2.sql which are present in same directory as A.sql also runs.
    Ashish,
    Yes the assumption is correct. Although when I cd to this directory then this issue won't come for sure.
    But the requirement is you can't 'cd' to the directory and want to execute with complete path.
    There is no issues in Solaris as the space is not allowed.

  • SWF files under Windows Media player

    When running .swf files in a .net application (running the
    Microsoft Media Player control), the files play correctly but
    either loop continuously (if loop is set to true) or hold on the
    last frame displaying continously. The application requires that
    the file plays and then closes allowing another one in the playlist
    to start.
    The application works fine with other media types such as
    mpg's wmv's and avi's but I don't want to use these for obvious
    size and ease of use purposes.

    Try your "My Music" folder; that's the default repository for music ripped by WMP.

Maybe you are looking for

  • Mac user needs HELP!

    I see that someone else had a similar problem, but never really got a resolution. I need to install Authoware for some online classes that I am taking. I am working on a Mac in OS X. I have downloaded the appropriate version of Authorware, "Unstuffed

  • How get the metadata with intermedia?

    Hi all, In my application I record Microsoft Word documents into a blob column, but before record this file I need to verify the version of Microsoft Word who created this file. Anyone can help me with this? Tks, Everson

  • How to dump .mod directly into iMovie without having to convert to .m4v?

    I cannot dump my video directly into iMovie 9 from Canon FS200. It goes to a document which I then have to laboriously convert - one clip at a time - to .m4v using Handbrake. Only then will iMovie take them. How do I bypass that conversion and get vi

  • Search crashes

    OracleJSP: oracle.jsp.provider.JspCompileException: Errors compiling:/u01/app/oracle/product/IAS904/j2ee/OC4J_Portal/application-deployments/wwwotn/wwwotn/persistence/_pages//_searchotnerr.java Line # Error 219 [jsp src:line #:498] cannot resolve sym

  • P2V a Citrix Virtual machine (offline)

    I am wanting to P2V a virtual machine. If you are wondering why not do a V2V I can't add the Xenserver hosts to SCVMM 2012 since the Xenserver I am running is 6.2 (which isn't supported with SCVMM 2012 SP1). There are a couple that I would prefer to