I have the problem when I add a java file to my project,the project struct is as below:
ScreenLockTes.java is the new java file and DisplayTest.java is the original one :
Before I added the ScreenLockTes.java my project works fine ,but after I added that file and rebuild the project I got the problem.
my build and test step is :
1、android create uitest-project -t 2 -n screenlocktest -p
E:\Users\ss\workspace\DisplayUIAutomationTestCses
2、ant clean build
3、adb push
E:\Users\ss\workspace\DisplayUIAutomationTestCses/bin/screenlocktest.jar /data/local/tmp
4、adb shell uiautomator runtest screenlocktest.jar -c ScreenLockTest
when I use the above step 4 command to run the test I got the Didn't find class " on path: DexPathList error.
However,when I chang the command to "adb shell uiautomator runtest screenlocktest.jar -c com.android.uiautomator.ScreenLockTest#SwipScreenLockTest" the test can run correctly .And I find that eventhough the test can run.
It seems that the setUp() and tearDown() function attched to the SwipScreenLockTest() function did not run at all.
What is wrong with my project?Do I have some wrong project configuration?
Related
I want to install COM port to connect my "Extended" controller (stabilization solution) but the software when plugged in, doesn't show any COM 3 ports. Found this solution https://github.com/NeuronRobotics/nrjavaserial
My steps: using the command git clone, after it is downloaded, I changed the directory to the folder it created.
$ cd nrjavaserial
After that, I tried to use this command.
$./gradlew build But it failed. Leaving this messagge in terminal :
What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]
Any ideas? My guess is that java is not installed correctly or something is missing. Or support for this is not there.. Thank you in advance.
Using JAVA JDK jdk-18.0.2.1.jdk
M1 Macbook Air.
I mistakenly executed those two lines on console:
rm -rf ~/Library/Application\ Support/Code/Cache/*
rm -rf ~/Library/Application\ Support/Code/CachedData/*
I hoped to clear cache to improve speed, but then I discovered that it deletes some key files and I failed debug my java file every time after then which said:
bash-3.2$
/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home/bin/java
--enable-preview -Dfile.encoding=UTF-8 -cp /private/var/folders/58/tqd41r6x5rlfzms1y1rx7s_m0000gn/T/vscodesws_cb741/jdt_ws/jdt.ls-java-project/bin
Test Error: Could not find or load main class Test Caused by:
java.lang.ClassNotFoundException: Test
Could not find or load main class? But in the file the main class is right declared and I successfully ran before the problem occurred.
Thank you very much!
I figured out at last. Just open a folder and you can do for free. Also, don't change setting.json . After I reinstalled macOS...(Yes, there's no mistake here) I got a right setting.json and here's its code:
{
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.errors.incompleteClasspath.severity": "ignore",
"files.autoSave": "afterDelay",
"java.configuration.checkProjectSettingsExclusions": false,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"terminal.integrated.lineHeight": 0,
"python.jediEnabled": false
}
I am trying to run a simple spring batch job from linux command line using the following command:
$PATH_TO_JAVA -cp $PATH_TO_JAR/dependency-jars/*;$PATH_TO_JAR/SpringBatchExample.jar org.springframework.batch.core.launch.support.CommandLineJobRunner file:resources/spring/batch/jobs/job-read-files.xml readMultiFileJob
But getting the following error:
Error: Could not find or load main class ...dependency-jars.commons-logging-1.1.1.jar
commons-logging-1.1.1.jar file is present in $PATH_TO_JAR/dependency-jars folder. Please advise.
Im trying to upload my project to circleci but from some reason it fails in a dropdown called "$ play test", I have no idea what is it, and I dont have tests in my project at all.
this is the section im talking about:
and im getting error there, this is the error:
I deleted "- sbt test" from my circle.yml so its not that, and I saw another folder of test in play so I thought maybe its that, but its empty, so I created a file in it and put nothing in it and still getting the same error...its driving me crazy ://///
please helpppppp
if you need this is my circle.yml:
machine:
services:
- docker
java:
version: oraclejdk8
environment:
SBT_VERSION: 0.13.9
SBT_OPTS: "-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
dependencies:
cache_directories:
- "~/.sbt"
- "~/.ivy2"
- "~/.m2"
- "~/docker"
pre:
- wget --output-document=$HOME/bin/sbt-launch.jar https://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/"$SBT_VERSION"/sbt-launch.jar
- echo "java $SBT_OPTS -jar \`dirname \$0\`/sbt-launch.jar \"\$#\"" > $HOME/bin/sbt
- chmod u+x $HOME/bin/sbt
- sbt sbt-version
override:
- sbt clean update
post:
- find . -type f -regex ".*/target/test-reports/.*xml" -exec cp {} $CIRCLE_TEST_REPORTS/ \;
general:
artifacts:
- "target/universal/*.tgz"
deployment:
feature:
branch: /.*/
commands:
- docker login -e admin#something.com -u ${ART_USER} -p ${ART_KEY} docker-local.artifactoryonline.com
- sbt -DBUILD_NUMBER="${CIRCLE_BUILD_NUM}" docker:publish
CircleCI has a feature called Inference that looks at what language your project is in as well as directories found, file extensions, etc to guess what dependencies and test you have.
If you look to the right of where you saw "play test" you'll see that it says "inference" which means this test was a result of Interference and not circle.yml. Inference made an assumption you needed the Play test framework (https://www.playframework.com/) and thus ran a default check, play test (the $ is part of the prompt).
If this is not what you want, which looks to be the case, you'll need to override the test command to instead run whatever test you want. This would be something like:
test:
override:
- echo "This is my test"
- ./my-custom-command
More information: https://circleci.com/docs/configuration/#test
I have Nodejs - server.js code in my windows system from which i want to execute a simple jar file.
So i used follwoing code :
cmd = "java -jar C:\\libs\\sample.jar";
var Exec =exec(cmd, function(error, stdout, stderr) {
if (error !== null) {
console.log('exec error: ' + error);
}//end of if
});//end of exec cmd
When i run the "node server.js" in command prompt ,jar is executing perfectly.
After this i made this "node server.js" command as service by referring following link :
https://github.com/coreybutler/node-windows
i.e node-windows,But now once its become service i am unable to exectue simple.jar,even i am enble to run simple "java -version" command.
Except java all other command are working fine even after i made nodejs as service.
Please help me out.....
New Update : After testing lot of different cases, Finally i came to know that jars containing JFrame components is not opening...how to solve this