How to run JavaFX jar with JRE7 on MAC OS Lion 10.7.5?

I created a jar of JavaFX application bundled with ANT on Windows 8 OS, 64-bit computer. I have 1.7.0_09 JavaFx2.0 and Java installed on my Windows O.S.
<target name="CreatingJars" depends="Compiling" description="generate the distribution" >
                    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"      
                             uri="javafx:com.sun.javafx.tools.ant" classpath="${env.JAVA_HOME}/lib/ant-javafx.jar"/>
                             
                          <mkdir dir="${WorkingFolder}/temp/libs"/>
                         <copy todir="${WorkingFolder}/temp/libs">
                         <fileset file="${WorkingFolder}/CustomJars/ProjectLib.jar">
                         </fileset>
                         </copy>
                         <copy todir="${WorkingFolder}/temp/libs">
                         <fileset dir="${WorkingFolder}/libs">
                         </fileset>
                    </copy>
                    
                    <fx:jar destfile="${WorkingFolder}/${app.name}.jar">
                    <fx:application mainClass="${main.class}"/>
                    <fx:resources>
                         <fx:fileset dir="${WorkingFolder}/temp/"/>
                    </fx:resources>
                         
                    <fileset dir="${WorkingFolder}/build"/>
                    <fileset dir="${WorkingFolder}/resources"/>
                    </fx:jar>
     </target> 
When I am trying to run this JavaFX application pot on the use of MAC OS Lion 10.7.5

java-jar application.jar

He always shows a dialog box "application requires a newer version of Java Run-time" with the download link. Even I downloaded and successfully installed on my Mac, but it always shows me the same window.

Java-version is still point to 1.6.

Then I tried Java preferences to point to the current JRE 1.7, but I could find preferences Java Applications-> utilities-> Java-> Java Preferences.

I would like to know - how to run JavaFX jar with JRE7 on MAC OS Lion 10.7.5? Is their another way to run the JavaFX JAR with JRE7 application?

Read this article:
http://blog.hgomez.net/blog/2012/07/20/understanding-Java-from-command-line-on-OSX/
The article is excellent and you will understand how to set the java runtime for Mac environment.

Try:

export JAVA_HOME=`/usr/libexec/java_home -v 1.7`
java -version
java -jar application.jar

Also, it's lion not far away, although the lions like kidneys :-)

Tags: Java

Similar Questions

  • How to run execute immediate with variables

    Hi friends,
    How to run execute immediate with variables in v_stmt below?
    I don't know how to declare value I have here.
    Set serveroutput on;
    DECLARE
       i        VARCHAR (20);
       v_stmt   VARCHAR2 (100);
    
       CURSOR c
       IS
          SELECT sqlid FROM temp1;
    
    
    BEGIN
       OPEN c;
    
       LOOP
          FETCH c INTO i;
          EXIT WHEN c%NOTFOUND;
          DBMS_OUTPUT.put_line (i);
          v_stmt := 'select * from table(dbms_xplan.display_cursor('&i',null))'
          execute immediate v_stmt;
       END LOOP;
    
       CLOSE c;
    END;
    /
    Regds,
    Kunwar.

    You must first use a variable binding (named ': v' in the SQL statement in my example):

    set serveroutput on;
    DECLARE
       i        VARCHAR (20);
       v_stmt   VARCHAR2 (100);
    
       CURSOR c
       IS
           -- modified for a quick test
          SELECT sql_id FROM v$sql where child_number > 2;
    
    BEGIN
       OPEN c;
    
       LOOP
          FETCH c INTO i;
          EXIT WHEN c%NOTFOUND;
          DBMS_OUTPUT.put_line (i);
          v_stmt := 'select * from table(dbms_xplan.display_cursor(:v,null))';
          execute immediate v_stmt using i;
       END LOOP;
    
       CLOSE c;
    END;
    /
    

    However because your SELECT statement returns multiple lines, you need to adapt your code to process all rows returned (as already suggested in first response to your message).

    Instead of using the PL/SQL, I recommend you to generate a SQL file using only SQL, and then run the generated SQL file.
    For example:

    spool edx.sql
    set serveroutput on
    declare
    v_stmt varchar2(100);
    v_q char(1):='''';
    begin
    dbms_output.put_line('spool edx.log');
    for s in (select sql_id from v$sql where child_number >2)
     loop
      dbms_output.put_line('select * from table(dbms_xplan.display_cursor(' || v_q || s.sql_id || v_q || ',null));');
     end loop;
     dbms_output.put_line('exit');
    end;
    /
    spool of
    

    This generates a file similar to:

    spool edx.log
    select * from table(dbms_xplan.display_cursor('5rygsj4dbw6jt',null));
    select * from table(dbms_xplan.display_cursor('5rygsj4dbw6jt',null));
    select * from table(dbms_xplan.display_cursor('5rygsj4dbw6jt',null));
    select * from table(dbms_xplan.display_cursor('fsbqktj5vw6n9',null));
    select * from table(dbms_xplan.display_cursor('6q42j0018w7t8',null));
    select * from table(dbms_xplan.display_cursor('a5mmhrrnpwjsc',null));
    select * from table(dbms_xplan.display_cursor('3c1kubcdjnppq',null));
    select * from table(dbms_xplan.display_cursor('3c1kubcdjnppq',null));
    select * from table(dbms_xplan.display_cursor('9gkq7rruycsjp',null));
    select * from table(dbms_xplan.display_cursor('f0wj261bm8snd',null));
    select * from table(dbms_xplan.display_cursor('ab3swhv5g138y',null));
    select * from table(dbms_xplan.display_cursor('6vgvyh4xw9c5g',null));
    select * from table(dbms_xplan.display_cursor('ak5crjygnpk60',null));
    select * from table(dbms_xplan.display_cursor('9p6bq1v54k13j',null));
    select * from table(dbms_xplan.display_cursor('19x1189chq3xd',null));
    select * from table(dbms_xplan.display_cursor('7sx5p1ug5ag12',null));
    select * from table(dbms_xplan.display_cursor('730vdzhng6m6g',null));
    select * from table(dbms_xplan.display_cursor('730vdzhng6m6g',null));
    select * from table(dbms_xplan.display_cursor('0v3dvmc22qnam',null));
    select * from table(dbms_xplan.display_cursor('0v3dvmc22qnam',null));
    select * from table(dbms_xplan.display_cursor('a1zv6wju3ftgv',null));
    select * from table(dbms_xplan.display_cursor('7ng34ruy5awxq',null));
    select * from table(dbms_xplan.display_cursor('7ng34ruy5awxq',null));
    select * from table(dbms_xplan.display_cursor('b2gnxm5z6r51n',null));
    select * from table(dbms_xplan.display_cursor('b2gnxm5z6r51n',null));
    select * from table(dbms_xplan.display_cursor('g4gp07gt2z920',null));
    select * from table(dbms_xplan.display_cursor('1gu8t96d0bdmu',null));
    select * from table(dbms_xplan.display_cursor('g00cj285jmgsw',null));
    select * from table(dbms_xplan.display_cursor('g00cj285jmgsw',null));
    select * from table(dbms_xplan.display_cursor('g00cj285jmgsw',null));
    select * from table(dbms_xplan.display_cursor('bn4b3vjw2mj3u',null));
    select * from table(dbms_xplan.display_cursor('38243c4tqrkxm',null));
    select * from table(dbms_xplan.display_cursor('2abjfnvy5rkyg',null));
    select * from table(dbms_xplan.display_cursor('350f5yrnnmshs',null));
    select * from table(dbms_xplan.display_cursor('350f5yrnnmshs',null));
    select * from table(dbms_xplan.display_cursor('3s1yukp05bzg6',null));
    select * from table(dbms_xplan.display_cursor('3s1yukp05bzg6',null));
    select * from table(dbms_xplan.display_cursor('1tgukkrqj3zhw',null));
    exit
    
    PL/SQL procedure successfully completed.
    

    Edited by: P. Forstmann March 20, 2013 19:06

    Edited by: P. Forstmann March 20, 2013 19:33

  • How to run a procedure with parameters in pl/sql collections?

    I created a procedure with parameter from the collection. Can somone help me how to run a procedure in passing the parameters in the collection.
    Package and how to create is successful. But I get the error message when executing the procedure.

    ORA-06550: line 3, column 19:
    PLS-00222: no function with name 'T_TAB' does exist in this scope

    I gave the example of code here. Can someone please help me solve this problem.

    -Spec package

    create or replace package pkg_dist is

    TABLE index IS THE NUMBER of t_tab_num TYPE of PLS_INTEGER;


    procedure prc_test (a t_tab_num IN,
    b IN t_tab_num,
    c IN OUT t_tab_num);
    end pkg_dist;

    -Package body

    create or replace package body is pkg_dist

    procedure prc_test (a t_tab_num IN,
    b IN t_tab_num,
    c IN OUT t_tab_num) is


    Start


    IF (a (16) = 0) then
    (16) c: = 0;
    c (17): = 0;
    c (18): = 0;
    end if;
    c (15): = (14)-(15)-a (16);
    (16) c: = b (16) /b (17);
    c (17): = 50;
    (18) c: = a (16) * 2;

    end prc_test;
    end pkg_dist;

    -executeing procedure

    declare
    TABLE index IS THE NUMBER of t_tab TYPE of PLS_INTEGER;
    x t_tab: = t_tab (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
    y t_tab: = t_tab (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
    z t_tab;
    BEGIN
    pkg_dist.prc_test (x, y, z);
    dbms_output.put_line (z (18));
    END;

    Error:
    --------------------------------------------------------------------------------
    ORA-06550: line 3, column 19:
    PLS-00222: no function with name 'T_TAB' does exist in this scope

    My suggestion would be:

    CREATE OR REPLACE PACKAGE pkg_dist IS
    
       PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist);
    END pkg_dist;
    
    CREATE OR REPLACE PACKAGE BODY pkg_dist IS
       PROCEDURE prc_test (a IN SYS.odcinumberlist, b IN SYS.odcinumberlist, c IN OUT SYS.odcinumberlist) IS
       BEGIN
          IF (a (16) = 0) THEN
             c (16) := 0;
             c (17) := 0;
             c (18) := 0;
          END IF;
    
          c (15) := a (14) + a (15) + a (16);
          c (16) := b (16) / b (17);
          c (17) := 50;
          c (18) := a (16) * 2;
       END prc_test;
    END pkg_dist;
    /
    
    DECLARE
       x   SYS.odcinumberlist;
       y   SYS.odcinumberlist;
       z   SYS.odcinumberlist;
    BEGIN
       x := sys.odcinumberlist (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
       y := sys.odcinumberlist (0,10,15,20,25,30,35,40,45,50,60,75,100,125,150,200,250,500);
       z := sys.odcinumberlist (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);
       pkg_dist.prc_test (x, y, z);
       DBMS_OUTPUT.put_line (z (18));
    END;
    /
    

    See you soon,.
    Manik.

  • How to run a procedure with refcursor to more

    an entry is User_id = CMSH_USER; p_Ot-num =-9999; p_ppst_flag = 'P' and I want to take the trace by running this procedure, and any1 help me, how to run this procedure below and how to use these 5 on refcursor...
     procedure Pr_get_mny(p_ot_Num      IN NUMBER,
                                     p_User_Id      IN VARCHAR2,
                                     p_Ppst_Flag IN VARCHAR2,
                                     Ref_Cur        OUT Ref_Cursor,
                                     CUR_OPT        OUT Ref_Cursor,
                                     CUR_TAXRATE    OUT Ref_Cursor,
                                     CUR_TAXHOLD    OUT Ref_Cursor,
                                     CUR_PENDGAACNT OUT Ref_Cursor
                                     ) IS

    If the goal is to Test, the best tool is SQL

    var ref_cur refcursor
    var cur_opt refcursor
    var cur_taxrate refcursor
    var cur_taxhold refcursor
    var cur_pendgaacnt refcursor 
    
    exec pr_get_mny(-9999,'CMSH_USER','P',:ref_cur,:cur_opt,:cur_taxrate,:cur_taxhold,:cur_pendgaacnt)
    
    print ref_cur
    print cur_opt
    print cur_taxrate
    print cur_taxhold
    print cur_pendgaacnt
    
  • How to run a procedure with the object as OUTPUT parameter

    Hello

    I have a procedure and it composed of 2 parameters, there is an input parameter and it's some ID (NUMBER datatype) and 2nd parameter is an output parameter and it an object type. I want to run this procedure, but not able to do the same thing. Can someone please suggest me how to run a procedure that got the object as output parameter.

    Thank you very much in advance for your support.

    Example:

    SQL> create or replace type t_obj as object (ename varchar2(10), deptno number);
      2  /
    
    Type created.
    
    SQL> ed
    Wrote file afiedt.buf
    
      1  create or replace procedure myproc (p_empno in number, obj out t_obj) is
      2  begin
      3    select t_obj(ename, deptno)
      4    into obj
      5    from emp
      6    where empno = p_empno;
      7* end;
    SQL> /
    
    Procedure created.
    
    SQL> set serverout on
    SQL> declare
      2    v_obj t_obj;
      3  begin
      4    myproc(7788, v_obj);
      5    dbms_output.put_line(v_obj.ename||','||v_obj.deptno);
      6  end;
      7  /
    SCOTT,20
    
    PL/SQL procedure successfully completed.
    
  • How reverse "Run As Administrator" with indiv. software?

    A question of NTFS permissions:
    Can someone tell me the best way to clear the "Run As Administrator" status for the software once it has been power in this way, please? I have Firefox for this (for irrelevant reasons), via the dialog window right click on the .exe itself within programs program and regret. Thank you...

    This should make no difference how the software is installed.  It is sometimes useful, but does not add any right to space or special ermissions.  There is no way to 'Cancel', but as I said it makes no difference.  If you encounter a problem with the program, it is NOT the cause.

    If you want to get help from the program, please provide more information (name and version, the problem, ets.) and we will try to help you.

    I hope this helps.

    Good luck1

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • How to run the script with parameters such as alarm action .ps1

    Hello

    I know not how to configure alarms, I know that I can point to monitor cluster for changes (via the GUI), but... I have different groups and I would like to set an alarm by vCenter which monitors cluster for changes. Let's call it "RefreshCapacityInfoOnExternalDB".

    So, lets just say. I would like to run my script whenever a virtual computer is added, Reconfigured or ESX host are removed, added in a Cluster. The alarm would launch the .ps1 script written in turn the ability to update external db cluster info.

    Shortly said: ability to cluster values are changed

    What I need is this: run the script-> CapacityInfoRefresher.ps1 < Cluster_name_where_ReconfigEventsTookPlace >

    I guess that, first I need an environment variable (if it exists) that can be used as a parameter for the < Cluster_name_where_ReconfigEventsTookPlace > placeholder script. Right?

    Chapter 16 of the book of LucD & Friends "PowerCli reference" mentions some environment vars but I'm stuck. Anyone using these options?

    THX

    A.S.

    You can set your alarm on the node above in your vCenter tree, this way it will be active for all collections in the vCenter.

    These alarm environment variables are automatically available for your alarm script when it is triggered.

    These environment variables, you will be able to determine to which cluster the alarm was pulled.

    So I don't think that you need to pass this information as a parameter to the script.

    Perrhaps you could share what exactly alarm you want to set and what looks like the script which should trigger alarm.

    And Yes, I use these environment variables in scripts of alarm

  • BlackBerry smartphone how to remove "default calendar" with Desktop for Mac?

    Hello world

    I am a newbie to BB and have tried to solve this problem on my own using the advice in other posts without success. Any help is appreciated!

    I have a 9700 running 5.0. I have has little chance of integration iCal with my BB and have renounced that for now. During fighting with my phone, I bought a calendar of office and by default; There's a book CICAL for the office. How to I get rid of the default? The posts on this topic in the past of reference of utilities in DM to PC, but I'm on a Mac.

    Advice?

    Thank you

    David

    Thank you very much. Is it possible to remove entries from the calendar by default before you make the trip?

    David

  • Problems running Setup.app with e4200v2 and Mac network

    I bought a router e4200v2 about a year, but somehow, it got lost in my computer room and I don't a not localize until quite recently, just after I bought a new iMac running Yosemite. The new iMacs don't have an optical drive, so I downloaded the Setup.app since the support site of Linksys without problem.

    However, when I run the Setup.app, he starts a Setup Smart Wi - fi but stalls when it comes to about 25% of fact, with a message "could not find your router." I called Linksys, and even if this isn't their period of free support they gave me a free call since I'd just take the machine out of the box.

    We couldn't get the Setup.app to work, so they talked me through a manual installation. I can now access the net of my Wired iMac or any of the various devices wireless around the House (telephone, laptop, etc.).

    BUT it was only after I hung up I have realzed that the different functions available from the diddn t Smart Wifi configuration (for example, guest access) appear to be available.

    I don't want to pay for a support call, but it's really irritating. The Setup.app still does not work, and I see no way to not get LLA.

    Can anyone suggest a solution? Am I missing something simple?

    Thank you.

    I do not recommend the use of the software to configure the router in your case.

    On the contrary, to connect to the router and use the link below to access and configure.

    http://192.168.1.1

    Default user name: admin or empty

    Default password: admin

  • Problem with Opera on Mac OSX Lion Mtn

    I'm used to periodically download a new version of Flash Player from http://get.adobe.com/flashplayer/ , but this time I don't have a download button to press. He recognized me as a user of Mac with Opera but not display the button.

    I tried to download Safari, but I don't have the you have a different operating system or browser? invite, just a question if I wanted to download on another computer.

    The only change that I can remember doing was to download a new version of Shockwave Player just before the attempt above with Flash.

    Any ideas how I can get this new version of Flash for Opera?

    Thank you

    Bart

    There is only a SINGLE Flash Player for Mac, regardless of the browser (except for Chrome, which has its own porprietary plugin)

    You go very well Setup offline here: Flash Player (for Mac OS X)

    Right-click and ' Save as ' then exit Opera (and all other browsers you have open).

    Mount the DMG and run the installer.

  • How to integrate windows vista with service pack 2? I need to run an inplace upgrade.

    How to integrate windows vista with service pack 2? I need to run an inplace upgrade. I have a corrupt installation of SP 2 and I can't uninstall SP 2 I have been informed that the only way to do an inplace upgrade is with a sp2 disk unfortunately I do not have a disc of vista SP 2. can someone give me a complementary statement?

    Hello

    1. what happens when you try to uninstall service pack 2?

    2. do you get an error message?

    I suggest you to see this link on how to uninstall service pack 2 for Windows vista:

    http://Windows.Microsoft.com/en-us/Windows-Vista/learn-how-to-install-Windows-Vista-Service-Pack-2-SP2

    Check if that helps.

  • How to modify the data with dynamic TableView with dynamic columns in JAVAFX

    Today, it is the demo to display the data from the CSV to the custom class without doing DAT file on tableView in JavaFX 2.0. I call this TableView as dynamic TableView because the tableview automatically manages the columns and rows.
    My research on the editable on tableView, we have a custom of the class and apply it to tableView to show that this demo is > http://docs.oracle.com/javafx/2/ui_controls/table-view.htm

    But in this case I can't do that because we don't know how many example of column with the csv file or .dat file... I want to make editable on this tableView in this case add TextField in the TableCell. How do custom class (because you don't have how column...) and so to do custom class then what thedesign of a custom for this case class?

    Could you please help me?

    It's the demo of code to display your csv or dat file in TableView

    private void getDataDetailWithDynamic() {
      tblView
    .getItems().clear();
      tblView
    .getColumns().clear();
      tblView
    .setPlaceholder(new Label("Loading..."));
      
    // @Override



      
    try {
           
    File aFile = new File(txtFilePath.getText());
           
    InputStream is = new BufferedInputStream(new FileInputStream(aFile));
           
    Reader reader = new InputStreamReader(is, "UTF-8");

           
    BufferedReader in = new BufferedReader(reader);

           
    final String headerLine = in.readLine();
           
    final String[] headerValues = headerLine.split("\t");
           
    for (int column = 0; column < headerValues.length; column++) {
                 tblView
    .getColumns().add(
                 createColumn
    (column, headerValues[column]));
           
    }

           
    // Data:

           
    String dataLine;
           
    while ((dataLine = in.readLine()) != null) {
                
    final String[] dataValues = dataLine.split("\t");
                
    // Add additional columns if necessary:
                
    for (int columnIndex = tblView.getColumns().size(); columnIndex < dataValues.length; columnIndex++) {
                      tblView
    .getColumns().add(createColumn(columnIndex, ""));
                
    }
                
    // Add data to table:
                
    ObservableList<StringProperty> data = FXCollections.observableArrayList();
                
    for (String value : dataValues) {
                     data
    .add(new SimpleStringProperty(value));
                
    }
                 tblView
    .getItems().add(data);
           
    }
      
    } catch (Exception ex) {
           
    System.out.println("ex: " + ex.toString());
      
    }


      
    for(int i=0; i<tblView.getColumns().size(); i++) {
           
    TableColumn col = (TableColumn)tblView.getColumns().get(i);
           col
    .setPrefWidth(70);
      
    }
    }

    private TableColumn createColumn(
      
    final int columnIndex, String columnTitle) {
           
    TableColumn column = new TableColumn(DefaultVars.BLANK_CHARACTER);
           
    String title;
           
    if (columnTitle == null || columnTitle.trim().length() == 0) {
                title
    = "Column " + (columnIndex + 1);
           
    } else {
                title
    = columnTitle;
           
    }


           
    Callback<TableColumn, TableCell> cellFactory = new Callback<TableColumn, TableCell>() {
           
    @Override
           
    public TableCell call(TableColumn p) {

                
    System.out.println("event cell");
                
    EditingCellData cellExtend = new EditingCellData();
                
    return cellExtend;
           
    }
      
    };

      column
    .setText(title);
      column
    .setCellValueFactory(cellFactory);
      
    return column;
    }


    Thanks for your reading.

    See this thread: Re: dynamically create columns

    This example is not editable, but to do so, simply add something like

        column.setCellFactory(TextFieldTableCell.>forTableColumn());
    

    the createTableColumn (...) method.

    Either said by the way, where did you code that you pasted in your post? It looks like in my previous post.

    Post edited by: James_D

  • How can I close Firefox (closed) if properly run two windows with multiple tabs in each and I want to save them all?

    How can I close Firefox (closed) if properly run two windows with multiple tabs in each and I want to save them all? I tried to close each window by clicking the X in the top right, and then restart Firefox only loads the last closed window. Is it possible to close Firefox so it restarts with both windows?

    Hi osenochen, some additions to the first response:

    • You can display the classic menu temporarily bar by pressing Alt or F10 to access the file menu
    • There is also an icon of 'power' at the bottom of the graphic application menu (the one which is displayed by the button "3-bar" menu) If you prefer
    • If you closed a window and you want to re - open, go to the history menu and see a list of recently closed windows (by default, up to 3 windows closed are stored and can be re-opened - not applicable to windows private)
  • How to run multiple simultaneous backups with VDR 1.2

    I have several VDR 1.2 devices, using every two CIFS shares for data warehouses.  I did not any changes in the .ini on devices file (the file does exist), but I am only able to write a backup at a time.  If I try to run a job manually all-in-one runs, it fails with a message telling me to look under "Reports" error messages.  However, there is nothing there.  I also can not save/restore the integrity checks are running.  It was also a problem of point 1.1, but it would actually give an error message that they data store was busy.

    I tried to import a whole new camera VDR and by attaching it to a new data store - same result.

    Does anyone have an idea what might happen?

    Thank you.

    Allen Beddingfield

    Systems engineer

    The University of Alabama

    Yes, exactly. We first had a VDR with 12 GB of RAM and 4 vCPUs and were not able to run several jobs once. Now, we decided to create two VDR each 4 GB RAM Max. Now, everything works!

    See you soon

    Nils

  • How to run the packaged procedure with Ref Cursor

    Hello.
    The question may be very simple for you... but I was confused how to run
    I have the following package
    CREATE OR REPLACE PACKAGE CURSPKG AS 
        TYPE T_CURSOR IS REF CURSOR; 
        PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER, 
                                   IO_CURSOR IN OUT T_CURSOR); 
        
    END CURSPKG;
    / 
    
    
    CREATE OR REPLACE PACKAGE BODY CURSPKG AS
        PROCEDURE OPEN_ONE_CURSOR (N_EMPNO IN NUMBER,
                                   IO_CURSOR IN OUT T_CURSOR)
        IS 
            V_CURSOR T_CURSOR; 
        BEGIN 
            IF N_EMPNO <> 0 
            THEN
                 OPEN V_CURSOR FOR 
                 SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                      FROM EMP, DEPT 
                      WHERE EMP.DEPTNO = DEPT.DEPTNO 
                      AND EMP.EMPNO = N_EMPNO;
    
            ELSE 
                 OPEN V_CURSOR FOR 
                 SELECT EMP.EMPNO, EMP.ENAME, DEPT.DEPTNO, DEPT.DNAME 
                      FROM EMP, DEPT 
                      WHERE EMP.DEPTNO = DEPT.DEPTNO;
    
            END IF;
            IO_CURSOR := V_CURSOR; 
        END OPEN_ONE_CURSOR; 
    
        
    END CURSPKG;
    /
    But I want to test (run) this procedure...
    But confused how to have Ref Cursor
    Could you help me in this...

    Thank you

    You must declare a variable of type T_CURSOR and pass it to the procedure like this.

    declare
      lOutCursor CURSPKG.T_CURSOR;
    begin
      CURSPKG.OPEN_ONE_CURSOR(, lOutCursor);
    end;
    

Maybe you are looking for