Tapatalk

How to fix not compilable error message on execution of compiled console Java application?

How to fix not compilable error message on execution of compiled console Java application?

5
NewbieNewbie
5

    Aug 30, 2015#1

    I am using UEStudio v14.20 to try to complete the Quickstart guide: Use UEStudio to develop Java applications.

    I am starting with the console application tutorial. It compiles correctly when I select Build, but when I select Run Application the output window shows the following error message:
    Error message wrote:This project is not compilable. If you want to compile it, please go to the project settings and check button "Compilable"
    The project settings are set to Compilable and it is compiled successfully. It created the .class and .jar files, and I can run them successfully from the command line.

    Please help me find whatever stupid thing I am doing wrong that prevents me from doing Run Application.

    Thanks, Dan

    6,685587
    Grand MasterGrand Master
    6,685587

      Aug 31, 2015#2

      I'm not using UES for Java development and therefore cannot really help on Java related problems. But perhaps I can help you to understand how Java configuration in UEStudio works and you can find out with this information what is the problem.

      First, click in UES in menu Build on menu item Select Compiler. You should see Java Compiler - Console Application selected. Click on button Edit Configuration to see the contents of the configuration file.

      At top displayed with green color because of comment lines the standard variables are listed and explained. Look on $T as this is an important one for running Java console applications.

      Scroll down to section [MakeCommands] as this contains the lines for the various commands executed from within UES via toolbar icon Commands. This icon is by default right of the exclamation mark with tooltip Run App. On clicking this icon you should see a popup menu with the command Execute. Try that command first.

      Most interesting on this problem is: run = Execute

      This means for running a compiled Java console application the section [Execute] defines the environment and commands.

      In section section [Execute] is defined:
      1. the title for the window on running the console application,
      2. that a successful execution depends on file $T which must be first [Build] if not existing already,
      3. the first and only command to execute with various parameters explained below in detail,
      4. a window should be displayed on running the application which should be a console window.
      Let us look on line with

      Cmd0 = @$(java) $(EOPT) $(Class Paths) -jar $T $(Program Arguments)

      The first character @ just results in hiding the command line finally used on starting the application like when using in a batch file as first character on a line.

      $(java) references the value of the variable java being defined above with java = java in section [Variables]. The configuration for a Java Windows application has javaw defined as application to run.

      $(EOPT references the value of the variable EOPT (execution options) which is defined also in section [Variables] above consisting itself of two variable references: $(VM) $(Launcher Options)

      VM is a variable which contains a setting defined in [Settings] which can be set via Build - Set Compiler Options. You should have already selected in compiler options if the console application is a client or a server application if I'm right on interpreting this Java specific setting.

      Launcher Options is a variable which contains a setting defined in [Settings] which can be set via Build - Set Compiler Options and is by default an empty string. You can define here in compiler options dialog any command line options which should be used on running the built console application.

      $(Class Paths) references value of setting Class Paths which is by default just a dot to define current directory as class path directory. UEStudio sets always the current directory to directory of target file on running the built application or starting build job (Or is it the project directory, I'm currently not sure.)

      And $(Program Arguments) references value of setting Program Arguments for appending options to command line which are passed to main of your Java application.

      I'm not really sure why you get the error message when you have checked already Compilable at Project - Project Settings on tab Settings and the project is also opened in UEStudio. I don't see any mistake in configuration for run from [MakeCommands] and therefore would expect that java.exe is called with the appropriate parameters as defined by the Compiler Options for built target file $T.

      When I look on the other configuration files I found something interesting: only following three files contain [Execute] for run.
      • Java Compiler\Console Application
      • Java Compiler\Windows Application
      • Kick Assembler\Application
      All others have named the section [Execute Application] which could be the reason why on click of icon Run App the error message is shown as UES expects a section [Execute Application] in configuration.

      I suggest to click on button Make configuration local (save in project directory), then rename section [Execute] to [Execute Application] and change also the line run = Execute to run = Execute Application Save the modified configuration with button Save configuration and close dialog with button OK.

      Now try if command Run App (icon with exclamation mark in toolbar) works and really results in running built console application. Please let us now if that helped so that I could inform IDM support about this important mistake in Java (and Kick Assembler) configuration.
      Best regards from an UC/UE/UES for Windows user from Austria