Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: ExecuteJob_pentaho.java:4: error: package org.pentaho.di.core does not exist

  1. #1
    Join Date
    Feb 2017
    Posts
    2

    Default ExecuteJob_pentaho.java:4: error: package org.pentaho.di.core does not exist

    Hello,
    I am trying to execute a .ktr from a java program. However, when I try and compile the .java program I get the below error message.
    I included the following .jar files in the java classpath.
    kettle-core-3.2.2.jar

    Does anyone know what else I need to import or include? Or am i missing something entirely.
    Thanks.

    compile error:
    C:\java>javac ExecuteJob_pentaho.java
    ExecuteJob_pentaho.java:4: error: package org.pentaho.di.core does not exist
    import org.pentaho.di.core.*;
    ^


    below is the program:
    import java.io.File;
    import java.util.Properties;


    import org.pentaho.di.core.*;
    import org.pentaho.di.core.Const;
    import org.pentaho.di.core.exception.KettleException;
    import org.pentaho.di.core.KettleEnvironment;
    import org.pentaho.di.job.Job;
    import org.pentaho.di.job.JobMeta;




    public class ExecuteJob_pentaho {
    public static void main(String[] args) throws Exception {
    String filename = args[0];

    KettleEnvironment.init();

    JobMeta jobMeta = new JobMeta("C:\\Users\\Taylora1\\Desktop\\java\\DLL\\java_call_test_run.ktr", null);
    Job job = new Job(null, jobMeta);
    job.start();
    job.waitUntilFinished();

    if (job.getErrors()!=0) {
    System.out.println("Error encountered!");
    }
    }
    }

  2. #2
    Join Date
    Feb 2017
    Posts
    2

    Default Running a .ktr from a java program

    Hello,
    I am trying to execute a .ktr from a java program. However, when I try and compile the .java program I get the below error message.
    I included the following .jar files in the java classpath.
    kettle-core-3.2.2.jar

    Does anyone know what else I need to import or include? Or am i missing something entirely.
    Thanks.

    compile error:
    C:\java>javac ExecuteJob_pentaho.java
    ExecuteJob_pentaho.java:4: error: package org.pentaho.di.core does not exist
    import org.pentaho.di.core.*;
    ^


    below is the program:
    import java.io.File;
    import java.util.Properties;


    import org.pentaho.di.core.*;
    import org.pentaho.di.core.Const;
    import org.pentaho.di.core.exception.KettleException;
    import org.pentaho.di.core.KettleEnvironment;
    import org.pentaho.di.job.Job;
    import org.pentaho.di.job.JobMeta;




    public class ExecuteJob_pentaho {
    public static void main(String[] args) throws Exception {
    String filename = args[0];

    KettleEnvironment.init();

    JobMeta jobMeta = new JobMeta("C:\\Users\\Taylora1\\Desktop\\java\\DLL\\java_call_test_run.ktr", null);
    Job job = new Job(null, jobMeta);
    job.start();
    job.waitUntilFinished();

    if (job.getErrors()!=0) {
    System.out.println("Error encountered!");
    }
    }
    }

  3. #3
    Join Date
    Feb 2017
    Posts
    2

    Default

    Hi,
    try to add all of the jar-files to your classpath from the kettle\lib directory.
    It works fine at me.
    greetings
    rené

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.