-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: How to start web console with non-core lib #110
Comments
This has improved from version 415. You can now add multiple expressions (one per line) into javarepl.init file in current directory, for example: ./javarepl.init
then you can also add --expression flag when starting JavaREPL to pass single expression:
should output |
@albertlatacz instead of starting the webconsole with java-repl-415.jar and then add the :cp joda-time.jar, can't we start the webconsole by adding it directly to the jar file ? |
Sure, it's more in a case where you don't want to embed it. Not sure if I understand what you're trying to do. Do you want to reuse web console and expose it in your app? |
@albertlatacz yah your right .. i want to reuse web console and expose to ma app.. |
Unfortunately it's not exposed at the moment. There is a way to connect to embedded repl. What you could do is to configure it like in javarepl.examples.EmbedInApplication and then connect command line repl with
Hope that helps. |
@albertlatacz i get the below error ~/git/AppiumJavaRepl/target (master ✘)✭ ᐅ java -jar appiumrepljava-1.0-SNAPSHOT.jar --hostname=127.0.0.1 --port 8001:::- Appium Java REPL -::: Enter import static com.appium.repl.Appium.*; Enter import io.appium.java_client.*; Enter AppiumDriver driver = driver.start(path_to_json_file in quotes) Type driver. tab to get all appium commandsWelcome to JavaREPL version null (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111) |
I think I understand now. Appium bundles all libraries required, right? So you could package them all in fat jar build.gradle plugins {
id "com.github.johnrengelman.shadow" version "1.2.4"
}
apply plugin: 'java'
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2" }
}
jar {
manifest {
attributes 'Main-Class': 'com.javarepl.App'
}
}
dependencies {
compile 'com.javarepl:javarepl:417'
compile 'joda-time:joda-time:2.9.6'
} Then start JavaREPL like so package com.javarepl;
import javarepl.Main;
public class App {
public static void main(String[] args) throws Exception {
Main.main(args);
}
} then after building with $ gradle clean shadowJar you should have javarepl-app-all.jar then run $ java -jar build/libs/javarepl-app-all.jar Example project below |
@albertlatacz this just builds the fat jar with java-repl as base. i was able to do this with ma project.All that i wanted to do is, acess the fat jar through webconsole .. Working example:: https://github.com/saikrishna321/AppiumReplJava mvn clean install java -jar target/appiumrepljava-1.0-SNAPSHOT.jar this gets the java repl, i want to access the same from webconsole |
@albertlatacz awesome that was quick, works well. Is there a way we can set port and hostname? this didnt work Welcome to JavaREPL version null (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_111) |
Ok, try version 424 including port as you were. |
@albertlatacz i have used java-repl for building my project for testing purpose, and wanted to embed it into web by starting the jar which i have build
for ex: java -jar appiumrepl.jar from command line
If i embed the iframe for webconsole which is provided that gets the java-repl.jar by default, instead i want the webconsole to start with the jar which i build..
any help on this ?
The text was updated successfully, but these errors were encountered: