Difference between revisions of "Statistical Algorithms Importer: Java Project"

From Gcube Wiki
Jump to: navigation, search
(Example Code)
Line 3: Line 3:
 
|}
 
|}
 
   
 
   
:This page explains how to create a Python project using the Statistical Algorithms Importer (SAI) portlet.
+
:This page explains how to create a Java project using the Statistical Algorithms Importer (SAI) portlet.
 
[[Image:StatisticalAlgorithmsImporter_JavaBlackBox0.png|thumb|center|250px|Java Project, SAI]]
 
[[Image:StatisticalAlgorithmsImporter_JavaBlackBox0.png|thumb|center|250px|Java Project, SAI]]
  

Revision as of 15:55, 10 October 2017

This page explains how to create a Java project using the Statistical Algorithms Importer (SAI) portlet.
Java Project, SAI

Project Configuration

Define project's metadata
Java Info, SAI
Add input and output parameters and click on "Set Code" to indicate the main file to execute (i.e. the .jar file)
Java I/O, SAI
Add information about the running environment (e.g. Java version etc.)
Java Interpreter, SAI
After the software creation phase a Main.R file and a Taget folder are created
Java Create, SAI

Example Code

Java code in sample:
/**
 * 
 * @author Giancarlo Panichi
 * 
 *
 */
import java.io.File;
import java.io.FileWriter;

public class SimpleProducer
{
  public static void main(String[] args)
  {
    try
    {
      FileWriter fw = new FileWriter(new File("program.txt"));
      fw.write("Check: " + args[0]);
      fw.close();
    }
    catch (Exception e)
    {
      e.printStackTrace();
    }
  }
}

Example Download

File:JavaBlackBox.zip