Can't compile Java application

Can't compile Java application

3
NewbieNewbie
3

    Jan 25, 2005#1

    Feel like a dingbat, but I can't get UltraEdit to invoke 'javac' compiler.

    Here's my path: C:\jdk5.1.0_01\bin\javac %F

    What I get is just nothing - no reaction whatever. My 'javasource' folder is a subfolder after \bin.

    "C:\jdk5.1.0_01\bin\javac javasource\mypgm.java" works fine on the cmd line from within DOS box
    ***********************************************************
    2nd issue: on CMD line, following does not work:

    C:\jdk5.1.0_01\bin\java javasource\mypgm
    returns "exception in thread "main" java.lang.class.NoClassFoundDefError"

    I have to be IN my source folder to execute the 'java mypgm' cmd!

    What is going on here?

    mainframe programmer :D

    6,681583
    Grand MasterGrand Master
    6,681583

      Jan 25, 2005#2

      There is a difference between %f and %F. See help for details. Try this:

      Command line: "C:\jdk5.1.0_01\bin\javac.exe" "%f"
      Working Directory: %p

      The " should always be use with long file names. I don't know, but I think, javac is an exe so adding the extension disables the search of the windows kernel for a program named javac.

      If javac needs other executables from it's bin directory, you have to add the javac bin directory to your path environment variable, if is not already done.
      Best regards from an UC/UE/UES for Windows user from Austria

      3
      NewbieNewbie
      3

        Jan 25, 2005#3

        mofi, ich bedanke mich für deine Ideen, ich hab's probiert aber ohne Erfolg, hab' eigentlich alles probiert aber das wirkt nichts.

        You mention the path environment variable. Forgive my novice stature in the pc world. Does your reference mean that I should have updated a windows file like autoexec.bat? All I did was install the jdk directly under my C: drive.

        Thank you again for your assistance.

        jwesneski

          Jan 26, 2005#4

          For now i'll just keep compiling/executing via the DOS command line from

          C:\jdk1.5.0_01\bin\

          I've read from more experienced java folks that they feel that to be a better way to learn things anyway, at least for a novice.

          46
          Basic UserBasic User
          46

            Jan 26, 2005#5

            It seems you miss the PATH environment var.

            Try adding "C:\jdk1.5.0_01\bin\" to the environment.

            The way to do that depend on your OS (Win9x -> autoexec.bat, Win2000/XP -> System control panel), the windows help can tell you how to do.

            1
            NewbieNewbie
            1

              Feb 19, 2005#6

              jwesneski

              i think you should try mofi's way to compiler java since with long java file name, it is quite time consuming to type the filename each time you want to compile and execute the file. besides it is very hard to check errors with dos prompt.

              So here i give you settings which work on my PC (my java sdk is different from yours, so modifed the relevant settings)


              command line: C:\j2sdk1.4.2_07\bin\javac.exe "%f"
              working directory: %p
              menu item name: java compiler

              check boxes: save all file first, save active file, output to list box, show dos box, capture output

              shoulds be work :wink: