Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Create an executable

 
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to show that I can launch a Java script from VBScript/UFT.  

I have a working hello world type script in eclipse/java.  

A) How can I run a script from outside of Eclipse?  Can I launch a script inside of Eclipse from  the command line in the CMD window?

I am requesting to have the Java JDK installed.   After that I'd like to compile the code.  B) Would I be better using an exe or java extension?

C)Can an entire selenium script using TestNG be put into an executable file?  

Thanks,

Kevin
 
Marshal
Posts: 7785
536
Mac OS X VI Editor BSD Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Didn't get absolutely anything. Could you please rephrase all you have said?

Or clarify at first. In which language you have the code? Java <-> JavaScript <-> TypeScript <-> VBScript ?
 
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe one of the things you are asking is how to run a Java program (not script) from the command line.  This Wiki will help:

https://coderanch.com/wiki/659740/create-Java-program

The basic steps are:

* Download the JDK
* Set up your environment
* Compile your code (program)
* Launch your program

 
author & internet detective
Posts: 40239
819
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of Java are you using? The answer is different in Java 9+
 
kevin Abel
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Liutauras, Knute, Jeanne,
I appreciate your responses.  I don't know how to respond to a specific post. I'd appreciate someone telling me how to do this.  

I am using java version 1.8.0_221    I get this from java -version.

Thanks,

Kevin

 
kevin Abel
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My plan is to launch a bat batch file using vbscript inside of UFT Testing tool.  The batch file will call the java executable using

java -classpath . MooseGreetings

I will see how my experiment goes shortly
 
Knute Snortum
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

kevin Abel wrote: I don't know how to respond to a specific post. I'd appreciate someone telling me how to do this.  


* Find the post you want to respond to
* Press the Quote button.
* Edit the quoted text if necessary for clarity.
* (optional but recommended) Press the Preview button (next to the Submit button) to make sure everything looks the way it should.
 
Knute Snortum
Sheriff
Posts: 7108
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

kevin Abel wrote:My plan is to launch a bat batch file using vbscript inside of UFT Testing tool.  The batch file will call the java executable using

java -classpath . MooseGreetings

I will see how my experiment goes shortly


For a simple project like this you can leave off the "-classpath ." part.  You will be using classpaths when you start using jar files and other resources. "-classpath" can also be shortened to "-cp".
 
kevin Abel
Ranch Hand
Posts: 165
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:

kevin Abel wrote:My plan is to launch a bat batch file using vbscript inside of UFT Testing tool.  The batch file will call the java executable using

java -classpath . MooseGreetings

I will see how my experiment goes shortly


For a simple project like this you can leave off the "-classpath ." part.  You will be using classpaths when you start using jar files and other resources. "-classpath" can also be shortened to "-cp".



Appreciated.

Thanks,

Kevin
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic