How to set classpath inside docker container on windows machine - classpath

i'm trying to create a docker image to run my java program inside the container. i new to docker i have no idea how to set the classpath. i have a datafile.properties, Sample.java,lib folder which contains all my dependancy jar files and my webdriver inside the folder C:\users\accessibility in my local machine. Please find the dockerfile below:
FROM java8:jdk
WORKDIR C:\\accessibility
COPY Sample.java C:\\accessibility\\Sample.java
COPY ./lib C:\\accessibility\\lib
ENV CLASSPATH C:\\accessibility\\lib\\axe-selenium-2.0.jar;C:\\accessibility\\lib\\java-json;C:\\accessibility\\lib\\json-simple-1.1;C:\\accessibility\\lib\\selenium-java-2.45.0;C:\\accessibility\\lib\\selenium-server-standalone-3.4.0
RUN javac Sample.java
CMD ["java","Sample"]
i'm trying to run it using the below command:
docker build -t accessibility C:\users\accessibility
i get shown the below error:
Sending build context to Docker daemon 29.33 MB
Step 1/6 : FROM java8:jdk
---> 97491cd5aa74
Step 2/6 : WORKDIR C:\\accessibility
---> Using cache
---> 0c8cfb951153
Step 3/6 : COPY Sample.java C:\\accessibility\\Sample.java
---> d083489522eb
Removing intermediate container f794396cc8eb
Step 4/6 : ENV CLASSPATH C:\\accessibility\\lib\\axe-selenium-2.0.jar;C:\\accessibility\\lib\\java-json;C:\\accessibility\\lib\\json-simple-1.1;C:\\accessibility\\lib\\selenium-java-2.45.0;C:\\accessibility\\lib\\selenium-server-standalone-3.4.0
---> Running in 3f0da277efaa
---> 2c32806352cb
Removing intermediate container 3f0da277efaa
Step 5/6 : RUN javac Sample.java
---> Running in 8ba2e1e7b45c
Sample.java:9: error: package org.json does not exist
import org.json.JSONArray;
^
Sample.java:10: error: package org.json does not exist
import org.json.JSONException;
^
Sample.java:11: error: package org.openqa.selenium does not exist
import org.openqa.selenium.By;
^
Sample.java:12: error: package org.openqa.selenium does not exist
import org.openqa.selenium.WebDriver;
^
Sample.java:13: error: package org.openqa.selenium.chrome does not exist
import org.openqa.selenium.chrome.ChromeDriver;
^
Sample.java:14: error: package com.nft.parsing does not exist
import com.nft.parsing.Parsing;
^
Sample.java:15: error: package com.nft.testing does not exist
import com.nft.testing.Testing;
^
Sample.java:22: error: cannot find symbol
static Testing t=new Testing();
^
symbol: class Testing
location: class Sample
Sample.java:24: error: package org.json.simple does not exist
ArrayList<org.json.simple.JSONArray> final10=new ArrayList<org.json.simple.JSONArray>();
^
Sample.java:26: error: cannot find symbol
static JSONArray jsonresults=null;
^
symbol: class JSONArray
location: class Sample
Sample.java:32: error: package org.json.simple.parser does not exist
public static void main(String[] args) throws FileNotFoundException, IOException, org.json.simple.parser.ParseException, JSONException{
^
Sample.java:32: error: cannot find symbol
public static void main(String[] args) throws FileNotFoundException, IOException, org.json.simple.parser.ParseException, JSONException{
^
symbol: class JSONException
location: class Sample
Sample.java:22: error: cannot find symbol
static Testing t=new Testing();
^
symbol: class Testing
location: class Sample
Sample.java:24: error: package org.json.simple does not exist
ArrayList<org.json.simple.JSONArray> final10=new ArrayList<org.json.simple.JSONArray>();
^
Sample.java:59: error: cannot find symbol
WebDriver driver = new ChromeDriver();
^
symbol: class WebDriver
location: class Sample
Sample.java:59: error: cannot find symbol
WebDriver driver = new ChromeDriver();
^
symbol: class ChromeDriver
location: class Sample
Sample.java:62: error: cannot find symbol
driver.findElement(By.id("userName")).sendKeys("admin");
^
symbol: variable By
location: class Sample
Sample.java:63: error: cannot find symbol
driver.findElement(By.id("passWord")).sendKeys("welcome");
^
symbol: variable By
location: class Sample
Sample.java:64: error: cannot find symbol
driver.findElement(By.id("login")).click();
^
symbol: variable By
location: class Sample
Note: Sample.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
19 errors
it is not referring the jar files. classpath is not set properly. Kindly help me with the sample dockerfile or any advise on this would be helpful. Thanks in advance

Related

Flutter problem: Error when building for Web

Fairly new to Flutter, decided to build for Web and got these following errors:
Launching lib\main.dart on Edge in debug mode...
lib\main.dart:1
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:1
export 'package:firebase_core/src/internals.dart' hide guard;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:5
import 'package:firebase_core/src/internals.dart' as internals;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:2
export 'package:firebase_core/src/internals.dart' hide guardWebExceptions;
^
: Error: Error when reading '../../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/internals.dart': The system cannot find the file specified.
../…/src/internals.dart:6
import 'package:firebase_core/src/internals.dart' as internals;
^
: Error: Method not found: 'guard'.
../…/src/internals.dart:10
return internals.guard(
^^^^^
: Error: Method not found: 'guardWebExceptions'.
../…/src/internals.dart:11
return internals.guardWebExceptions(
^^^^^^^^^^^^^^^^^^
Failed to compile application.
Exited (sigterm)
I tried upgrading packages, but no luck. Any idea what might be causing this issue?

How to receive notification with one signal when app is in background or closed

I can only receive push notif when app is in foreground, followed instructions here and created a .java file in com.package.name now I have 2 files there MainActivity.java And NotificationServiceExtension.java
One signal version 3.4.2.
Also posted this on github
Added this on my manifest
<meta-data android:name="com.onesignal.NotificationServiceExtension"
android:value="com.bonfire.cdis.NotificationServiceExtension" />
Here is the error
Launching lib\main.dart on sdk gphone x86 64 in debug mode...
Running Gradle task 'assembleDebug'...
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:24: error: cannot find symbol
builder.setColor(new BigInteger("FF00FF00", 16).intValue());
^
symbol: class BigInteger
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:26: error: cannot find symbol
Spannable spannableTitle = new SpannableString(notification.getTitle());
^
symbol: class Spannable
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:26: error: cannot find symbol
Spannable spannableTitle = new SpannableString(notification.getTitle());
^
symbol: class SpannableString
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:27: error: cannot find symbol
spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
^
symbol: class ForegroundColorSpan
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:27: error: cannot find symbol
spannableTitle.setSpan(new ForegroundColorSpan(Color.RED),0,notification.getTitle().length(),0);
^
symbol: variable Color
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:30: error: cannot find symbol
Spannable spannableBody = new SpannableString(notification.getBody());
^
symbol: class Spannable
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:30: error: cannot find symbol
Spannable spannableBody = new SpannableString(notification.getBody());
^
symbol: class SpannableString
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:31: error: cannot find symbol
spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
^
symbol: class ForegroundColorSpan
location: class NotificationServiceExtension
D:\caps\cdis\android\app\src\main\java\com\bonfire\cdis\NotificationServiceExtension.java:31: error: cannot find symbol
spannableBody.setSpan(new ForegroundColorSpan(Color.BLUE),0,notification.getBody().length(),0);
^
symbol: variable Color
location: class NotificationServiceExtension
9 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
Exception: Gradle task assembleDebug failed with exit code 1

flutter permission_handler Build fail

I am trying to add the package permission_handler to my flutter project but I cannot run the app. I get a build error. This is the error I get
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionManager.java:321: error: cannot find symbol
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) {
^
symbol: variable S
location: class VERSION_CODES
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:72: error: cannot find symbol
case Manifest.permission.BLUETOOTH_SCAN:
^
symbol: variable BLUETOOTH_SCAN
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:74: error: cannot find symbol
case Manifest.permission.BLUETOOTH_ADVERTISE:
^
symbol: variable BLUETOOTH_ADVERTISE
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:76: error: cannot find symbol
case Manifest.permission.BLUETOOTH_CONNECT:
^
symbol: variable BLUETOOTH_CONNECT
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:259: error: cannot
find symbol
String result = determineBluetoothPermission(context, Manifest.permission.BLUETOOTH_SCAN);
^
symbol: variable BLUETOOTH_SCAN
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:270: error: cannot
find symbol
String result = determineBluetoothPermission(context, Manifest.permission.BLUETOOTH_ADVERTISE);
^
symbol: variable BLUETOOTH_ADVERTISE
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:281: error: cannot
find symbol
String result = determineBluetoothPermission(context, Manifest.permission.BLUETOOTH_CONNECT);
^
symbol: variable BLUETOOTH_CONNECT
location: class permission
C:\Users\Hp\dev\flutter\.pub-cache\hosted\pub.dartlang.org\permission_handler-8.2.5\android\src\main\java\com\baseflow\permissionhandler\PermissionUtils.java:370: error: cannot
find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S && hasPermissionInManifest(context, null, permission )) {
^
symbol: variable S
location: class VERSION_CODES
8 errors
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':permission_handler:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 2m 48s
I have reverted to an earlier version but I would like to know what is the cause of this error. My compile version is 30
as said in plugin github repository
These new permissions are supported on Android 12, to resolve this problem make sure to set the compileSdkVersion in your app/build.gradle file to 31.
for more information have a look at here

Symbolic linking issue in local postgres instance on MacOS

Having recently upgraded postgresql and gdal using homebrew, I am stuck with a could not load library error when trying to run a GDAL command that creates a connection to a local postgres database:
ERROR 1: ERROR: could not load library "/usr/local/lib/postgresql/postgis-3.so": dlopen(/usr/local/lib/postgresql/postgis-3.so, 10): Symbol not found: _hash_bytes
Referenced from: /usr/local/lib/postgresql/postgis-3.so
Expected in: /usr/local/opt/postgresql/bin/postgres
in /usr/local/lib/postgresql/postgis-3.so
ERROR 1: PROJ: proj_identify: Cannot find proj.db
ERROR 1: ERROR: could not load library "/usr/local/lib/postgresql/postgis-3.so": dlopen(/usr/local/lib/postgresql/postgis-3.so, 10): Symbol not found: _hash_bytes
Referenced from: /usr/local/lib/postgresql/postgis-3.so
Expected in: /usr/local/opt/postgresql/bin/postgres
in /usr/local/lib/postgresql/postgis-3.so
I am confused by the "Referenced from: Expected in:" part
When I check the folder /usr/local/lib/postgresql/ , I see that the postgis-3.so file is symbolically linked to another directory
cd /usr/local/lib/postgresql/
ls -l
returns
...
postgis-3.so -> ../../Cellar/postgis/3.0.3/lib/postgresql/postgis-3.so
How should this error be interpreted and are there any suggestions on further steps to take in this case?

error compiling my ionic app using ionic package

I am trying to build a release version of my Ionic app for android, using $ ionic package build android --release --profile profile_production, but I get the following error. Can you help please ?
Nota: ionic build android leads to no error.
:compileReleaseJavaWithJavac/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:11: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.GoogleAuthException;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:12: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.GoogleAuthUtil;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:13: error: package com.google.android.gms.auth does not exist
import com.google.android.gms.auth.UserRecoverableAuthException;
^
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:193: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:202: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:205: error: cannot find symbol
GoogleAuthUtil.clearToken(context, token);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:210: error: cannot find symbol
token = GoogleAuthUtil.getToken(context, email, scope);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:213: error: cannot find symbol
GoogleAuthUtil.clearToken(context, token);
^
symbol: variable GoogleAuthUtil
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:217: error: cannot find symbol
catch (UserRecoverableAuthException userAuthEx) {
^
symbol: class UserRecoverableAuthException
/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/src/nl/xservices/plugins/GooglePlus.java:227: error: cannot find symbol
} catch (GoogleAuthException e) {
^
symbol: class GoogleAuthException
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
10 errors
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 8.201 secs
Error: Error code 1 for command: /home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/gradlew with args: cdvBuildRelease,-b,/home/package/workspace/apps-bc689f0f-142/cordova/platforms/android/build.gradle,-Dorg.gradle.daemon=true,-Pandroid.useDeprecatedNdk=true
First time answering here, but this post worked for me, so I think I got to paste it here.
https://github.com/EddyVerbruggen/cordova-plugin-googleplus/issues/252
What i did change was the plugin installed, instead of the cordova normal plugin, i added the git one, like this code:
cordova plugin add https://github.com/EddyVerbruggen/cordova-plugin-googleplus --save --variable REVERSED_CLIENT_ID=myreversedclientid