Package not found when running javac











up vote
-4
down vote

favorite












I know that this question was already asked thousand times, but I still can't fully understand the point of the problem, especially in my case. So, I have simple project with dependency of TestNG and Selenium Java libraries, and I have these libraries installed globally, so my project just import them from "global" scope.



So to solve the problem I should add that global folder to my classpath ? Or this in not right from the beginning and I should not use libraries globally in projects ?



C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava>javac GoogleSearchTest.java
GoogleSearchTest.java:1: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
^
GoogleSearchTest.java:2: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
^
GoogleSearchTest.java:3: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
^
GoogleSearchTest.java:4: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
^
GoogleSearchTest.java:5: error: package org.testng.annotations does not exist
import org.testng.annotations.BeforeClass;
^
GoogleSearchTest.java:6: error: package org.testng.annotations does not exist
import org.testng.annotations.Parameters;
^
GoogleSearchTest.java:7: error: package org.testng.annotations does not exist
import org.testng.annotations.Test;
^
GoogleSearchTest.java:12: error: cannot find symbol
private static WebDriver driver;
^
symbol: class WebDriver
location: class GoogleSearchTest
GoogleSearchTest.java:14: error: cannot find symbol
@BeforeClass
^
symbol: class BeforeClass
location: class GoogleSearchTest
GoogleSearchTest.java:23: error: cannot find symbol
@Test
^
symbol: class Test
location: class GoogleSearchTest
GoogleSearchTest.java:24: error: cannot find symbol
@Parameters("querryText")
^
symbol: class Parameters
location: class GoogleSearchTest
GoogleSearchTest.java:17: error: cannot find symbol
driver = new ChromeDriver();
^
symbol: class ChromeDriver
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: variable By
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: variable By
location: class GoogleSearchTest
16 errors


GoogleSearchTest.java



import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

public class GoogleSearchTest {
private static WebDriver driver;

@BeforeClass
public void setup () {
System.setProperty("webdriver.chrome.driver", "C:\Program Files\chromedriver_win32\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.google.com/");
}

@Test
@Parameters("querryText")
public void doSearch(String querryText) {
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
searchField.sendKeys(querryText);
WebElement searchButton = driver.findElement(By.name("btnK"));
searchButton.click();
}
}









share|improve this question
























  • What do u mean by "Globally"?
    – Infamous
    Nov 10 at 13:03










  • In "Project structure" window, there are "Global libraries" in "Platform settings". I installed libraries from there before starting the project, so all imports where available, and those libraries appeared in "Libraries" in "Project settings". And also in "Modules" -> "Dependencies". I mean libraries is not in my project structure, they in some separate IntelliJ IDEA folder.
    – Wonderio619
    Nov 10 at 13:08












  • Can you show the code and the exception that you are getting while building?. Plus, I honestly advise you to use something like Gradle or Maven to manage your dependencies and the building process rather than relying heavily on IDE tools. Javac is a command used to compile the code provided by JDK itself (not by IDE), and javac doesn't know about the classpath (IDE does, that's why you can run the project from the IDE run button).
    – Infamous
    Nov 10 at 13:31










  • I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
    – Wonderio619
    Nov 10 at 13:44






  • 1




    Possible duplicate of how to include libraries in java without using an IDE
    – Infamous
    Nov 10 at 13:50















up vote
-4
down vote

favorite












I know that this question was already asked thousand times, but I still can't fully understand the point of the problem, especially in my case. So, I have simple project with dependency of TestNG and Selenium Java libraries, and I have these libraries installed globally, so my project just import them from "global" scope.



So to solve the problem I should add that global folder to my classpath ? Or this in not right from the beginning and I should not use libraries globally in projects ?



C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava>javac GoogleSearchTest.java
GoogleSearchTest.java:1: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
^
GoogleSearchTest.java:2: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
^
GoogleSearchTest.java:3: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
^
GoogleSearchTest.java:4: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
^
GoogleSearchTest.java:5: error: package org.testng.annotations does not exist
import org.testng.annotations.BeforeClass;
^
GoogleSearchTest.java:6: error: package org.testng.annotations does not exist
import org.testng.annotations.Parameters;
^
GoogleSearchTest.java:7: error: package org.testng.annotations does not exist
import org.testng.annotations.Test;
^
GoogleSearchTest.java:12: error: cannot find symbol
private static WebDriver driver;
^
symbol: class WebDriver
location: class GoogleSearchTest
GoogleSearchTest.java:14: error: cannot find symbol
@BeforeClass
^
symbol: class BeforeClass
location: class GoogleSearchTest
GoogleSearchTest.java:23: error: cannot find symbol
@Test
^
symbol: class Test
location: class GoogleSearchTest
GoogleSearchTest.java:24: error: cannot find symbol
@Parameters("querryText")
^
symbol: class Parameters
location: class GoogleSearchTest
GoogleSearchTest.java:17: error: cannot find symbol
driver = new ChromeDriver();
^
symbol: class ChromeDriver
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: variable By
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: variable By
location: class GoogleSearchTest
16 errors


GoogleSearchTest.java



import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

public class GoogleSearchTest {
private static WebDriver driver;

@BeforeClass
public void setup () {
System.setProperty("webdriver.chrome.driver", "C:\Program Files\chromedriver_win32\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.google.com/");
}

@Test
@Parameters("querryText")
public void doSearch(String querryText) {
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
searchField.sendKeys(querryText);
WebElement searchButton = driver.findElement(By.name("btnK"));
searchButton.click();
}
}









share|improve this question
























  • What do u mean by "Globally"?
    – Infamous
    Nov 10 at 13:03










  • In "Project structure" window, there are "Global libraries" in "Platform settings". I installed libraries from there before starting the project, so all imports where available, and those libraries appeared in "Libraries" in "Project settings". And also in "Modules" -> "Dependencies". I mean libraries is not in my project structure, they in some separate IntelliJ IDEA folder.
    – Wonderio619
    Nov 10 at 13:08












  • Can you show the code and the exception that you are getting while building?. Plus, I honestly advise you to use something like Gradle or Maven to manage your dependencies and the building process rather than relying heavily on IDE tools. Javac is a command used to compile the code provided by JDK itself (not by IDE), and javac doesn't know about the classpath (IDE does, that's why you can run the project from the IDE run button).
    – Infamous
    Nov 10 at 13:31










  • I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
    – Wonderio619
    Nov 10 at 13:44






  • 1




    Possible duplicate of how to include libraries in java without using an IDE
    – Infamous
    Nov 10 at 13:50













up vote
-4
down vote

favorite









up vote
-4
down vote

favorite











I know that this question was already asked thousand times, but I still can't fully understand the point of the problem, especially in my case. So, I have simple project with dependency of TestNG and Selenium Java libraries, and I have these libraries installed globally, so my project just import them from "global" scope.



So to solve the problem I should add that global folder to my classpath ? Or this in not right from the beginning and I should not use libraries globally in projects ?



C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava>javac GoogleSearchTest.java
GoogleSearchTest.java:1: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
^
GoogleSearchTest.java:2: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
^
GoogleSearchTest.java:3: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
^
GoogleSearchTest.java:4: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
^
GoogleSearchTest.java:5: error: package org.testng.annotations does not exist
import org.testng.annotations.BeforeClass;
^
GoogleSearchTest.java:6: error: package org.testng.annotations does not exist
import org.testng.annotations.Parameters;
^
GoogleSearchTest.java:7: error: package org.testng.annotations does not exist
import org.testng.annotations.Test;
^
GoogleSearchTest.java:12: error: cannot find symbol
private static WebDriver driver;
^
symbol: class WebDriver
location: class GoogleSearchTest
GoogleSearchTest.java:14: error: cannot find symbol
@BeforeClass
^
symbol: class BeforeClass
location: class GoogleSearchTest
GoogleSearchTest.java:23: error: cannot find symbol
@Test
^
symbol: class Test
location: class GoogleSearchTest
GoogleSearchTest.java:24: error: cannot find symbol
@Parameters("querryText")
^
symbol: class Parameters
location: class GoogleSearchTest
GoogleSearchTest.java:17: error: cannot find symbol
driver = new ChromeDriver();
^
symbol: class ChromeDriver
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: variable By
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: variable By
location: class GoogleSearchTest
16 errors


GoogleSearchTest.java



import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

public class GoogleSearchTest {
private static WebDriver driver;

@BeforeClass
public void setup () {
System.setProperty("webdriver.chrome.driver", "C:\Program Files\chromedriver_win32\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.google.com/");
}

@Test
@Parameters("querryText")
public void doSearch(String querryText) {
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
searchField.sendKeys(querryText);
WebElement searchButton = driver.findElement(By.name("btnK"));
searchButton.click();
}
}









share|improve this question















I know that this question was already asked thousand times, but I still can't fully understand the point of the problem, especially in my case. So, I have simple project with dependency of TestNG and Selenium Java libraries, and I have these libraries installed globally, so my project just import them from "global" scope.



So to solve the problem I should add that global folder to my classpath ? Or this in not right from the beginning and I should not use libraries globally in projects ?



C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava>javac GoogleSearchTest.java
GoogleSearchTest.java:1: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
^
GoogleSearchTest.java:2: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
^
GoogleSearchTest.java:3: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebElement;
^
GoogleSearchTest.java:4: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
^
GoogleSearchTest.java:5: error: package org.testng.annotations does not exist
import org.testng.annotations.BeforeClass;
^
GoogleSearchTest.java:6: error: package org.testng.annotations does not exist
import org.testng.annotations.Parameters;
^
GoogleSearchTest.java:7: error: package org.testng.annotations does not exist
import org.testng.annotations.Test;
^
GoogleSearchTest.java:12: error: cannot find symbol
private static WebDriver driver;
^
symbol: class WebDriver
location: class GoogleSearchTest
GoogleSearchTest.java:14: error: cannot find symbol
@BeforeClass
^
symbol: class BeforeClass
location: class GoogleSearchTest
GoogleSearchTest.java:23: error: cannot find symbol
@Test
^
symbol: class Test
location: class GoogleSearchTest
GoogleSearchTest.java:24: error: cannot find symbol
@Parameters("querryText")
^
symbol: class Parameters
location: class GoogleSearchTest
GoogleSearchTest.java:17: error: cannot find symbol
driver = new ChromeDriver();
^
symbol: class ChromeDriver
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:26: error: cannot find symbol
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
^
symbol: variable By
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: class WebElement
location: class GoogleSearchTest
GoogleSearchTest.java:28: error: cannot find symbol
WebElement searchButton = driver.findElement(By.name("btnK"));
^
symbol: variable By
location: class GoogleSearchTest
16 errors


GoogleSearchTest.java



import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;

import java.util.concurrent.TimeUnit;

public class GoogleSearchTest {
private static WebDriver driver;

@BeforeClass
public void setup () {
System.setProperty("webdriver.chrome.driver", "C:\Program Files\chromedriver_win32\chromedriver.exe");
driver = new ChromeDriver();
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.google.com/");
}

@Test
@Parameters("querryText")
public void doSearch(String querryText) {
WebElement searchField = driver.findElement(By.cssSelector("#lst-ib"));
searchField.sendKeys(querryText);
WebElement searchButton = driver.findElement(By.name("btnK"));
searchButton.click();
}
}






java javac






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 10 at 13:41

























asked Nov 10 at 13:00









Wonderio619

75




75












  • What do u mean by "Globally"?
    – Infamous
    Nov 10 at 13:03










  • In "Project structure" window, there are "Global libraries" in "Platform settings". I installed libraries from there before starting the project, so all imports where available, and those libraries appeared in "Libraries" in "Project settings". And also in "Modules" -> "Dependencies". I mean libraries is not in my project structure, they in some separate IntelliJ IDEA folder.
    – Wonderio619
    Nov 10 at 13:08












  • Can you show the code and the exception that you are getting while building?. Plus, I honestly advise you to use something like Gradle or Maven to manage your dependencies and the building process rather than relying heavily on IDE tools. Javac is a command used to compile the code provided by JDK itself (not by IDE), and javac doesn't know about the classpath (IDE does, that's why you can run the project from the IDE run button).
    – Infamous
    Nov 10 at 13:31










  • I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
    – Wonderio619
    Nov 10 at 13:44






  • 1




    Possible duplicate of how to include libraries in java without using an IDE
    – Infamous
    Nov 10 at 13:50


















  • What do u mean by "Globally"?
    – Infamous
    Nov 10 at 13:03










  • In "Project structure" window, there are "Global libraries" in "Platform settings". I installed libraries from there before starting the project, so all imports where available, and those libraries appeared in "Libraries" in "Project settings". And also in "Modules" -> "Dependencies". I mean libraries is not in my project structure, they in some separate IntelliJ IDEA folder.
    – Wonderio619
    Nov 10 at 13:08












  • Can you show the code and the exception that you are getting while building?. Plus, I honestly advise you to use something like Gradle or Maven to manage your dependencies and the building process rather than relying heavily on IDE tools. Javac is a command used to compile the code provided by JDK itself (not by IDE), and javac doesn't know about the classpath (IDE does, that's why you can run the project from the IDE run button).
    – Infamous
    Nov 10 at 13:31










  • I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
    – Wonderio619
    Nov 10 at 13:44






  • 1




    Possible duplicate of how to include libraries in java without using an IDE
    – Infamous
    Nov 10 at 13:50
















What do u mean by "Globally"?
– Infamous
Nov 10 at 13:03




What do u mean by "Globally"?
– Infamous
Nov 10 at 13:03












In "Project structure" window, there are "Global libraries" in "Platform settings". I installed libraries from there before starting the project, so all imports where available, and those libraries appeared in "Libraries" in "Project settings". And also in "Modules" -> "Dependencies". I mean libraries is not in my project structure, they in some separate IntelliJ IDEA folder.
– Wonderio619
Nov 10 at 13:08






In "Project structure" window, there are "Global libraries" in "Platform settings". I installed libraries from there before starting the project, so all imports where available, and those libraries appeared in "Libraries" in "Project settings". And also in "Modules" -> "Dependencies". I mean libraries is not in my project structure, they in some separate IntelliJ IDEA folder.
– Wonderio619
Nov 10 at 13:08














Can you show the code and the exception that you are getting while building?. Plus, I honestly advise you to use something like Gradle or Maven to manage your dependencies and the building process rather than relying heavily on IDE tools. Javac is a command used to compile the code provided by JDK itself (not by IDE), and javac doesn't know about the classpath (IDE does, that's why you can run the project from the IDE run button).
– Infamous
Nov 10 at 13:31




Can you show the code and the exception that you are getting while building?. Plus, I honestly advise you to use something like Gradle or Maven to manage your dependencies and the building process rather than relying heavily on IDE tools. Javac is a command used to compile the code provided by JDK itself (not by IDE), and javac doesn't know about the classpath (IDE does, that's why you can run the project from the IDE run button).
– Infamous
Nov 10 at 13:31












I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
Nov 10 at 13:44




I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
Nov 10 at 13:44




1




1




Possible duplicate of how to include libraries in java without using an IDE
– Infamous
Nov 10 at 13:50




Possible duplicate of how to include libraries in java without using an IDE
– Infamous
Nov 10 at 13:50












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










I finally understand how it should be done.
So, to compile class and then run TestNG test I done this:



javac -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* GoogleSearchTest.java

java -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava;C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* org.testng.TestNG testng.xml


More detailed, in first line to compile class there should be a following command template:



javac -cp "full path to libs folder, where project libraries located" "name of class to compile"


And for second line, which run TestNG test, template is:



java -cp "full path to folder where testng.xml file located";"full path to libs folder, where project libraries located" "testNG filename with extension"


And this is very tiresome, as you can see. I should learn proper way to run similar tests without headache ...



P.S. After all, I just learn Maven and there is no need for these commands now )






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














     

    draft saved


    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239203%2fpackage-not-found-when-running-javac%23new-answer', 'question_page');
    }
    );

    Post as a guest
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    I finally understand how it should be done.
    So, to compile class and then run TestNG test I done this:



    javac -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* GoogleSearchTest.java

    java -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava;C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* org.testng.TestNG testng.xml


    More detailed, in first line to compile class there should be a following command template:



    javac -cp "full path to libs folder, where project libraries located" "name of class to compile"


    And for second line, which run TestNG test, template is:



    java -cp "full path to folder where testng.xml file located";"full path to libs folder, where project libraries located" "testNG filename with extension"


    And this is very tiresome, as you can see. I should learn proper way to run similar tests without headache ...



    P.S. After all, I just learn Maven and there is no need for these commands now )






    share|improve this answer



























      up vote
      0
      down vote



      accepted










      I finally understand how it should be done.
      So, to compile class and then run TestNG test I done this:



      javac -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* GoogleSearchTest.java

      java -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava;C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* org.testng.TestNG testng.xml


      More detailed, in first line to compile class there should be a following command template:



      javac -cp "full path to libs folder, where project libraries located" "name of class to compile"


      And for second line, which run TestNG test, template is:



      java -cp "full path to folder where testng.xml file located";"full path to libs folder, where project libraries located" "testNG filename with extension"


      And this is very tiresome, as you can see. I should learn proper way to run similar tests without headache ...



      P.S. After all, I just learn Maven and there is no need for these commands now )






      share|improve this answer

























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        I finally understand how it should be done.
        So, to compile class and then run TestNG test I done this:



        javac -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* GoogleSearchTest.java

        java -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava;C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* org.testng.TestNG testng.xml


        More detailed, in first line to compile class there should be a following command template:



        javac -cp "full path to libs folder, where project libraries located" "name of class to compile"


        And for second line, which run TestNG test, template is:



        java -cp "full path to folder where testng.xml file located";"full path to libs folder, where project libraries located" "testNG filename with extension"


        And this is very tiresome, as you can see. I should learn proper way to run similar tests without headache ...



        P.S. After all, I just learn Maven and there is no need for these commands now )






        share|improve this answer














        I finally understand how it should be done.
        So, to compile class and then run TestNG test I done this:



        javac -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* GoogleSearchTest.java

        java -cp C:UsersYaroslavIdeaProjectsGoogleSearchTestsrcmainjava;C:UsersYaroslavIdeaProjectsGoogleSearchTestlib* org.testng.TestNG testng.xml


        More detailed, in first line to compile class there should be a following command template:



        javac -cp "full path to libs folder, where project libraries located" "name of class to compile"


        And for second line, which run TestNG test, template is:



        java -cp "full path to folder where testng.xml file located";"full path to libs folder, where project libraries located" "testNG filename with extension"


        And this is very tiresome, as you can see. I should learn proper way to run similar tests without headache ...



        P.S. After all, I just learn Maven and there is no need for these commands now )







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited 21 hours ago

























        answered Nov 10 at 14:40









        Wonderio619

        75




        75






























             

            draft saved


            draft discarded



















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53239203%2fpackage-not-found-when-running-javac%23new-answer', 'question_page');
            }
            );

            Post as a guest




















































































            Popular posts from this blog

            Full-time equivalent

            さくらももこ

            13 indicted, 8 arrested in Calif. drug cartel investigation