Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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
 
Sheriff
Posts: 7646
522
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: 40035
809
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
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic