Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
Run from Java the whole app YACY
Marek Otahala231d0eeb9ab
diff --git a/build.xml b/build.xmlindex 099bd77f7..e05e27721 100644--- a/build.xml+++ b/build.xml@@ -79,7 +79,7 @@<target name="buildGitRevTask"><delete file="${libbuild}/GitRevTask.jar" failonerror="false" />- <javac srcdir="${libbuild}/GitRevTask">+ <javac srcdir="${libbuild}/GitRevTask" includeantruntime="true"><classpath><pathelement location="${libbuild}/org.eclipse.jgit-1.1.0.201109151100-r.jar" /></classpath>@@ -199,7 +199,7 @@<!-- compile yacyBuildProperties.java --><javac srcdir="${build}" destdir="${build}" sourcepath="${src}"- debug="true" debuglevel="lines,vars,source"+ debug="true" debuglevel="lines,vars,source" includeantruntime="false"includes="net/yacy/peers/operation/yacyBuildProperties.java"source="${javacSource}" target="${javacTarget}"><classpath refid="project.class.path" />@@ -209,7 +209,7 @@<!-- compile the core sources --><javac srcdir="${src}/" destdir="${build}"- debug="true" debuglevel="lines,vars,source"+ debug="true" debuglevel="lines,vars,source" includeantruntime="false"excludes="net/yacy/peers/operation/yacyBuildProperties.java"source="${javacSource}" target="${javacTarget}"><classpath refid="project.class.path" />@@ -251,7 +251,7 @@<javac srcdir="${htroot}/"excludes="processing/**"source="${javacSource}" target="${javacTarget}"- debug="true" debuglevel="lines,vars,source">+ debug="true" debuglevel="lines,vars,source" includeantruntime="false"><classpath refid="project.class.path" /><compilerarg value="-Xlint"/></javac>diff --git a/source/net/yacy/utils/StartFromJava.java b/source/net/yacy/utils/StartFromJava.javanew file mode 100644index 000000000..b272b0797--- /dev/null+++ b/source/net/yacy/utils/StartFromJava.java@@ -0,0 +1,55 @@+/*+ * To change this template, choose Tools | Templates+ * and open the template in the editor.+ */+package net.yacy.utils;++import java.util.Scanner;+import java.util.logging.Level;+import java.util.logging.Logger;+import net.yacy.gui.framework.Browser;++/**+ * Allow running the aplication yacy from java, useful from running from IDE etc+ *+ * @author marek+ */+public class StartFromJava {++ private String cmdStart = "./startYACY.sh";+ private String cmdStop = "./stopYACY.sh";++ public StartFromJava() {+ //FIXME: rewrite browser to general use utility UtilExecuteFile+ if(Browser.systemOS != Browser.systemUnix) {+ throw new UnsupportedOperationException("RUN for other os than Linux not done yet.");+ }+ }++ public void start() throws Exception {+ Browser.openBrowser(cmdStart);+ }++ public void stop() throws Exception {+ Browser.openBrowser(cmdStop);+ }++ public static void main(String[] args) {+ try {+ StartFromJava run = new StartFromJava();+ run.start();+ System.out.println("run ./stopYACY.sh to stop it or type STOP here");+ Scanner sc = new Scanner(System.in);+ String s = "aaa";+ do {+ System.out.println("type STOP to stop YACY");+ s = sc.nextLine();+ } while(!"STOP".equals(s));++ run.stop();++ } catch(Exception ex) {+ Logger.getLogger(StartFromJava.class.getName()).log(Level.SEVERE, null, ex);+ }+ }+}