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();
}
}
java javac
|
show 8 more comments
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();
}
}
java javac
What do u mean by "Globally"?
– Infamous
2 days ago
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
2 days ago
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
2 days ago
I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
2 days ago
1
Possible duplicate of how to include libraries in java without using an IDE
– Infamous
2 days ago
|
show 8 more comments
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();
}
}
java javac
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
java javac
edited 2 days ago
asked 2 days ago
Wonderio619
75
75
What do u mean by "Globally"?
– Infamous
2 days ago
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
2 days ago
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
2 days ago
I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
2 days ago
1
Possible duplicate of how to include libraries in java without using an IDE
– Infamous
2 days ago
|
show 8 more comments
What do u mean by "Globally"?
– Infamous
2 days ago
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
2 days ago
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
2 days ago
I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
2 days ago
1
Possible duplicate of how to include libraries in java without using an IDE
– Infamous
2 days ago
What do u mean by "Globally"?
– Infamous
2 days ago
What do u mean by "Globally"?
– Infamous
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
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
2 days ago
I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
2 days ago
I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
2 days ago
1
1
Possible duplicate of how to include libraries in java without using an IDE
– Infamous
2 days ago
Possible duplicate of how to include libraries in java without using an IDE
– Infamous
2 days ago
|
show 8 more comments
1 Answer
1
active
oldest
votes
up vote
0
down vote
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 ...
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
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 ...
add a comment |
up vote
0
down vote
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 ...
add a comment |
up vote
0
down vote
up vote
0
down vote
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 ...
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 ...
edited 2 days ago
answered 2 days ago
Wonderio619
75
75
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
What do u mean by "Globally"?
– Infamous
2 days ago
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
2 days ago
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
2 days ago
I updated question with exceptions and class I tried to compile. I also moved my dependency libraries in lib folder in project structure.
– Wonderio619
2 days ago
1
Possible duplicate of how to include libraries in java without using an IDE
– Infamous
2 days ago