Coder Social home page Coder Social logo

Comments (2)

TylerJewell avatar TylerJewell commented on May 10, 2024

Hi.

Right now, you have to create an arbitrary command that runs your java
file. It's a bit of manual effort, but we will add helpers to simplify
this soon.

Here is an example:

  1. Try cloning from github http://github.com/vparfonov/executable_jar_sample
  2. In the project configuration, set this project to maven project type.
  3. You may need to go into the maven settings and specifically set it to a
    jar.
  4. Add a command, maven type, title it "build". This will do a mvn clean
    install on the project, which should build it.
  5. Add an arbitrary command, title it "run".

You will need to provide the path to the JAR file. It should be something
like, "java -jar projects/target/....". To find the specific location of
the jar, you can navigate in the terminal. The terminal is in the
operations view (upper right corner of IDE). You can navigate the folder
structure there.

In a near release, we'll have the terminal on the main screen, and we'll
also provide helpers for generating these commands that execute files &
folders in your project tree.

Tyler Jewell | CEO | tyler@​codenvy.​com | 9​78​.8​84​.53​55

On Thu, Dec 3, 2015 at 10:36 PM, freewind [email protected] wrote:

I installed the latest eclipse-che and created a simple maven java
project. It contains a very simple Java application:

package maven_test;
/** * Hello world! * */public class App
{
public static void main( String[] args )
{
System.out.println( "Hello World!" );
}
}

And a test:

package maven_test;
import junit.framework.Test;import junit.framework.TestCase;import junit.framework.TestSuite;
/** * Unit test for simple App. /public class AppTest
extends TestCase
{
/
* * Create the test case * * @param testName name of the test case */
public AppTest( String testName )
{
super( testName );
}

/**     * @return the suite of tests being tested     */
public static Test suite()
{
    return new TestSuite( AppTest.class );
}

/**     * Rigourous Test :-)     */
public void testApp()
{
    assertTrue( true );
}

}

I want to run the application or the test, and chose the Java 7 runner.
It works, but finally gives me an error:

[DOCKER] Removing intermediate container 75ec0758cf27
[DOCKER] Successfully built ec65a2f775dc
[INFO] Environment preparation done. Application maven-test starting up…
[STDERR] no main manifest attribute, in application.jar
[INFO] Run ended @ Fri Dec 04 06:33:55 UTC 2015
[INFO] Application maven-test has been shutdown.

How to configure che to support running a specified Java file?


Reply to this email directly or view it on GitHub
#105.

from che.

 avatar commented on May 10, 2024

Hello,

Take a look - https://github.com/vparfonov/executable_jar_sample/blob/master/pom.xml#L17

We package the project into a JAR, and run java -jar application.jar command.

So, adding Main class reference to your pom.xml will fix it. It's not flexible. This is resolved in 4.0 version where you can create custom commands and pass main class as an argument in a command.

Further Maven integration is definitely on the roadmap, smth like running test for a chosen class or a method.

from che.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.