Trying to get JUnit working on my computer. I'm using windows but I have also installed git bash as well (don't know if that makes a difference).
Anyway I've followed this tutorial linked below:
https://www.tutorialspoint.com/junit/junit_environment_setup.htm
I'm trying to set the environment variables manually on windows but the instructions above aren't working for me.
https://imgur.com/a/NaqFiue
^Here is a photo of my user variables after making the changes in the tutorial. On the above tutorial it says to link the JDK to a variable called JAVA_HOME, and mine worked perfectly with Path as seen in the image but it did not work with JAVA_HOME.
I'm honestly so confused, lost and frustrated. Any help would be appreciated.
Why does your classpath settings has so many semi-colons?
You haven't set JAVA_HOME yet. Usually it's necessary to set
JAVA_HOME, as it's assumed by most Java libraries. You can set the
Java path by %JAVA_HOME%\bin.
What is your commmand line to run Junit? Have you compiled
successfully?
JUnit has its own Getting Started. Can you try it instead of the tutorial that you used. It does not rely on environment variables. Therefore it should be easier to run it.
Related
I've configured an environment variable in ~/.bashrc as well as ~/.profile.
When I run my application via IDEA's Gradle Configuration, my environment variable is apparently not available. E.g. I am referencing this variable within application.yml, but the default value is being used instead. Running Gradle from the command line correctly picks up my variable.
How can I configure IDEA to load this environment variable in a global way, so I don't have to manually add it to every project where I need it (~20 projects)?
Note: running on Manjaro Linux v18.
It turns out IDEA will pick up environment variables if you define them either in e.g. /etc/environment or /etc/profileor if you use ZSH,~/.zshrc`.
After setting variables, you to execute source ~/.bashrc and source profile to update and execute the file contents.
# josh-m I ran into the same problem in my IntelliJ IDEA setup with Maven.
In the end, I continued to keep the settings on each project, as there were not many, but when I studied the problem I found this IntelliJ support link:
https://youtrack.jetbrains.com/issue/IDEA-141832
At least at that time, this functionality was not available in IntelliJ directly, although the following plugin, mentioned in the comments of the support article, could perhaps be of some help:
https://plugins.jetbrains.com/plugin/7861-envfile/
launchctl setenv HADOOP_VERSION 3.1.1.7.2.8.0-SNAPSHOT
Execute in this way to set your environment variables in MacOS for them to be used by other applications.
After that restart your IDE.
Working with our dev team to get apple push notifications working and I need some help getting a jar into the java bootclass path. We are running RHEL 6.9 and java8.
when I try to do the normal: java -Xbootclasspath/p:/opt/batch/lib/pathtojar.jar I dont seem to be getting any confirmation nor errors. simply prints our the java help page.
I've also confirmed we are using the correct alpn-boot jar for our java version. I'm probably just running into a wall I cant see at the moment, so any help would be appreciated.
answer to problem:
the script we run for this job is not continuous, therefore I simply had to add the -Xbootclasspath/p:/opt/batch/lib/pathtojar.jar to the calls in the script. whereas i thought the command was supposed to be passed to change a value to a configuration file.
simply me misunderstanding something I had never done before.
I just started working with Cordova/PhoneGap and when I want to use the command "cordova run android" on my newly created application, it goes somewhat like this:
C:\Users\tobbog\Desktop\MyNewApp>cordova run android
ANDROID_HOME=C:\Users\tobbog\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_144
The system cannot find the path specified
However, the two paths above are both perfectly like that in my Environmental Variables. How can it be that it doesn't find the path?
Thanks in advance for any help!
Remove android by the below command
cordova platform rm android
Then add the version 5 by the below command
cordova platform add android#~5
That should help!
You may also want to place the paths in quotation marks " ", since it's possible the space in "Program Files" is throwing it off, I know this happens often when trying to run certain programs via command line that take file arguments. So maybe write it like this:
C:\Users\tobbog\Desktop\MyNewApp>cordova run android
ANDROID_HOME="C:\Users\tobbog\AppData\Local\Android\sdk"
JAVA_HOME="C:\Program Files\java\jdk1.8.0_144"
Can't be 100% sure though as I'm unfamiliar with what that program expects (cordova) and other options that may be supplied to it! You could always try checking the readme or documentation related to that program, it probably shows some examples as to how to run something similar.
See how it even changes in the Stack Overflow text formatting? It's possible once it hits that white space after Files (in C:\Program Files) that it's ignoring the rest of the path, so basically you're trying to specify this path for JAVA_HOME:
C:\Program
And that's it! Would explain why it can't find that path since you probably don't have just a "Program" directory!
I found the answer to my problem! The problem was that I installed and uninstalled the Android Development Kit before. During the uninstal, it didn't delete all of the folders so that I had to delete them manually before installing Android again.
Ok im wondering where does xamarin get this path from?
Severity Code Description Project File Line Source Suppression State
Error The specified task executable location "C:\Program Files (x86)\Java\jdk1.7.0_71\\bin\javac.exe" is invalid.
So I can go and change it to the new jdk1.8. I have the new JDK set up I just need to know where to change the path at.
I had the same problem and solution is.
Remove all jdk and install jdk 1.8
Change reference java location in Visual Studio Tool > Options > Xamarin
Clean and Rebuild Project
I've just solved this exact problem for me.
I don't know why you wouldn't have a JDK_HOME variable. Completely remove the JDK and install it again maybe?
The Environment Variables for java were set to my previously installed path. I guess Oracle screwed up here.
As I had the same error, here's what I did:
I went to C:\Program Files\Java\ and checked what the jdk folder is called. For me it's jdk1.8.0_102.
For users who don't know where to find System Variables:
Go to System Properties and on the left hand side, click Advanced System Settings. Switch to the Advanced tab, click Environment Variables. Under System Variables there should be two variables in the list called JAVA_HOME and JDK_HOME.
I edited those values and change the path to what I found in the java folder. In my case this would be C:\Program Files\Java\jdk1.8.0_102.
No need to close VS, just build your app and it should get passed the annoying error.
Hope this helps :)
I had exactly the same problem. I got it to go away (which is not the same thing as fixing it).
Un-install every bit of JAVA you have. Delete both JAVA folders (Program Files and Program Files (x86)).
Install the latest version of the Java (x32) SDK.
Clean and Rebuild your project(s).
Since my Solution is multi-platform, I changed the Startup Project to the .iOS one, built it, ran it in an emulator, and set the Startup Project back to the .Droid project.
Somewhere in all this, the problem went away.
And remember kids! If it can go away all by itself, it can come back again all by itself!
I had this issue as well, I downloaded 32 bit Java but VS was still looking for the 64 bit one.
To solve it all I had to do was change the JAVA_HOME and the variable in my Path, clean my project and rebuild it.
Just set JAVA_HOME and JDK_HOME ambient variables, clean your solution and build again. For me worked fine.
Don't forget to clean your solution.
I was working on eclipse two days ago, and closed it properly.
Now, when I'm trying to start it, I get the splash screen popping for a blink of an eye, then disappearing.
I get:
no error message, and
no error is logged in the <workspace>\.metadata\.log file (the last errors logged there are from two days ago).
Apparently, the problem isn't with the workspace, because I changed the SHOW_WORKSPACE_SELECTION_DIALOG argument in <eclipse>\configurations\.settings\org.eclipse.ui.ide.prefs to true, and it doesn't even get as far as showing the dialog.
There's only one thing I can recall I did before it stopped working - I have installed a plugin for UFT Java Extensibility SDK from HP.
Needless to say uninstalling it didn't help.
Is there any other log I can hope to find helpful?
Or anything else I can do to get it to work?
EDIT:
I was just trying to start another instance of eclipse I have (adt-bundle-windows-x86-20130219), and got the same outcome.
EDIT:
I added Java & QTP to the title in order to help others who bumps into the same issue.
If the JRE is somehow the issue, try installing a JDK (not a JRE), in a non-default path (for instance, C:\Prog\Java\JDK1.7.0_xx), and make sure your eclipse.ini explicitly reference that JDK.
-vm
C:/Prog/Java/jdk1.7.0_21/jre/bin/server/jvm.dll
(you can use '/' even on Windows in an eclipse.ini file)
The problem was indeed with Java (Thanks Arne). Re-installing the jre didn't help, so I also tried to deleted the JAVA_OPTIONS and JAVA_TOOL_OPTIONS enviroment variables, which solved the problem.
Later, I found this discussion which seems related to my problem: http://h30499.www3.hp.com/t5/Unified-Functional-Testing/Environment-variables-JAVA-OPTIONS-and-JAVA-TOOL-OPTIONS-is/td-p/5855995.
I will look more deeply into it later, when I will start using HP's plugin, but I hope this thread can help others who run into trouble with eclipse after installing this plugin.