So while attempting to install JDK via new task on task manager, it gives me the following error message:
Unable to install Java
There are errors in the following switches: "(1).exe";
Check that the commands are valid and try again.
I searched for the problem using "There are errors in the following switches" and turned up only one result which didn't help (surprising, considering the internet we live in today). Any and all diagnostic help is much appreciated, I've run out of things to try.
Note: Only this .exe is giving me issues, all other .exe s run fine.
(The original poster has probably moved on. This is for people who encounter the same problem and find this Q&A via a Google search.)
The Question does not include enough information to diagnose the problem. Based on the little that has been provided, I would consider the following:
Maybe the ".exe" came from a suspect source. Download it again from the official Oracle Java download site. (Don't trust 3rd-party download sites. They may be serving up an installer that is actually a trojan horse, or loaded up with bloatware...)
The executable name "(1).exe" is most unusual. Maybe it is the name that is causing the installer to get confused. If the name got changed when you downloaded the file, try changing it back to whatever it should be ... or downloading it again.
You didn't say clearly how you tried to run the installer. Maybe you actually did invoke it the wrong way; e.g. with /(1).exe as a "switch".
Should I attempt a manual installation? Placing files where they need to go.
No. Bad idea. The installer should work if you have a genuine one and you run it the right way.
Related
So in the past days i've decompiled minecraft 1.12.2 using mcp to make an "own" client. I ran it from eclipse and all was working just fine. But once i exported it, added the needed JSON file and started it from the minecraft launcher, it resulted the following error:
Exception in thread "Client thread" java.lang.NoSuchMethodError: org.apache.logging.log4j.Logger.info(Ljava/lang/String;Ljava/lang/Object;)V
at net.minecraft.client.Minecraft.<init>(Minecraft.java:420)
at net.minecraft.client.main.Main.main(Main.java:115)
In my opinion that'a a bit strange, because when I ran it from eclipse that error did NOT occur.
I was thinking about adding the logger in the specific JSON file for the version but I do not know how to do it. I took the JSON file from a video where I expected my problem to be solved, made some changes, but it didn't. I also put the folder containing the logger-jar (org.apache....) in the client jar, but still no success.
Also i just decompiled 1.12.2 and recompiled it right away to see if i had messed up my code some how.
I hope someone can help.
This means at runtime you have a class that is different than what you had at compile time. You should try unzipping the jar and searching for the class file. It sounds like you need to potentially remove it and replace it with your own version.
Thanks to all who viewed an wanted to help!
Now I found an other way to use it. I wanted to export it to test
it on my server. But instead I used my account credentials to log in directly from eclipse.
:)
The primary, direct issue right now is this: I can't open Eclipse anymore, and I can't seem to open Java, or execute Java codes-- all apparently in relation to an "Access is denied." error.
The first sign of this problem was when I tried to execute Hello World through Command Prompt. Following the instructions exactly in a video, when I attempted the apparent executing command code:
C:\Programs>java Helloworld
...I would get the message "Access is denied". After much troubleshooting, I found that if I gave the exact folder chain the program was in, I could get Hello World! to work. This looked like:
C:\Users\Spiralgo\Desktop\Coding>java HelloWorld
Ok, fair enough. But then it happened again in Eclipse. Following elsewhere in the video, there is the execution of the HelloWorld program directly in the Eclipse IDE. But when I followed the instructions exactly, I would get the following error:
CreateProcess error=5, Access is denied.
The file location shouldn't be a problem here... Since the code was getting written directly in Eclipse. I asked for help here in an earlier thread and was recommended to (1) try rewriting the code in Eclipse and then (2) to delete and reinstall Java. Rewriting the code led to the same error, so I tried deleting Java, and then reinstalling it. Some problems associated with this:
I can't tell if Java was properly deleted or not. There are so many Java files that I'm not sure if I deleted the right one, and there doesn't seem to be a convenient way to catch all of them in one deletion. I noticed there is a Java uninstaller program, but I can't tell if using that is properly deleting Java, or if I need to go a step further and erase everything before re-downloading.
When using the Java Uninstaller, the program warns me that I already have an up-to-date version of Java, and that the program is meant to be used to get rid of out-of-date versions of Java.
I tried downloading Java online after I thought I had deleted it. I simply went for what seemed to be the easiest download possible, on this site: (https://java.com/en/) and going through the big red button. This is different from the more "complicated" method described in the original download instructions I used, but I figured if I was having issues related to beginners, it would be fine to try a simpler route. However, this method seemed to download a different series of programs onto my computer: a Java folder containing the programs "About Java", "Check for Updates", "Configure Java", "Get Help", and "Visit java.com".
And guess what... Trying to open "Configure Java" leads to an "Access is denied" error! Here is the full message:
Java Control Panel
Access is denied.
"C:\Program Files (x86)\Java\jre1.8.0_261\bin\javaw.exe" -Xbootclasspath/a:"C:\Program Files (x86)\Java\jre1.8.0_261\bin..\lib\deploy.jar" -Djava.locale.providers=HOST,JRE,SPI -Djdk.disableLastUsageTracking -Dsun.java2d.dpiaware=true -Duser.home="C:\Users\Spiralgo" com.sun.deploy.panel.ControlPanel
And now Eclipse won't open. When clicking on it I get a very long message that begins with: "JVM terminated. Exit code=2".
So at this point I can't even tell if I have Java or not right now. I also don't know if all of this is related to the consistent "Access is denied" message related to Java, and whether that's related to using different Java versions, or if my computer itself has some inappropriate setting that restricts access to things.
You can read more about how this problem evolved from the previous thread: Access Denied running "Hello World" program through Eclipse
I'm a total Java noob so please understand =) I need a quick advice on how to fix the issue.
I cloned the official selenium git repo, changed the code a bit (need to dump the page into some specified dirs), and tried to rebuilt it:
./go //java/server/src/org/openqa/selenium/remote/server:server:uber //java/client/src/org/openqa/selenium:client-combined:uber
It was successful but when I tried to execute it I got this:
$ java -jar build/java/server/src/org/openqa/selenium/remote/server/server-standalone.jar
Failed to load Main-Class manifest attribute from
build/java/server/src/org/openqa/selenium/remote/server/server-standalone.jar
Tried to check classpath, CLASS_PATH and CLASSPATH env variables (as a friend of mine suggested) - I simply don't have any.
At the same time, the pre-compiled standalone server from the official downloads works out of the box.
The official docs didn't help. There's nothing about it there.
So - I need a quick advice how to compile it? Thanks.
P.S. JDK 8 (latest), Mac OS 10.7
P.P.S. That friend of mine tried to build it by himself and he was lucky - he got a new build/dist folder where the target big file was. But in my case, the build folder is created, but there's not 'dist' folder in it.
Finally found the answer: I should have built it like that:
./go clean release
it's really strange that all the docs state I need to use these long /bla/bla/:uber things to get a whole single 'uber' server.
First time post, long time watcher. Can't wait for my classmates to read this (they use the site too)
I am using Eclipse Juno w/ Java SE 1.7
I am having an eclipse problem. It doesn't happen all the time, typically only during File IO. I'm using my debugger perspective in Eclipse to try and trouble shoot some problems (its really a simple program).
UPDATE: Apparently new users are not allowed to upload screen shots. If you could take the time to click on the link to witness my problem I would appreciate it.
Screen Shot Link (not java code):
imgur.com/5IxI3.png
As you can see I am getting an odd thread.class problem. I have even reinstalled java. Could it be something with my code as well then?
Thanks for anyone who offers input or helps in anyway. I do have about a week before this is do so I'm not just looking for free answers, just frustrated. Thanks!
If I understand your question correctly, you need to attach source because Thread is API class.
Download Java source (not binary exe file) from Oracle
Go to eclipse Yourproject --> Properties --> Java Build Path >
Libraries and expand JRE System Library --> jre version--> rt.jar.
Select Source attachment ---> Point to the down loaded source.
Read this tutorial for more info.
I am working on a team project in Java. One requirement is that we dynamically populate a drop-down menu of all classes that implement a certain interface. New classes can be added after compile time. To accomplish this we are using reflection.
Problem: All of the drop-down menus are blank on my system. I cannot for the life of me figure out why they are not populating. All other 5 team members have it working on their system.
Things I tired that didn't work:
1) Installing most recent eclipse (galileo) because rest team was using it
2) Re-install most recent java release (jdk1.6.0-17 and jre6)
3) Check PATH and JAVA_HOME variables
Any thoughts as to what else I can try or if something I did should have solved it and didn't? It is driving me crazy.
Edit:
I should have been clearer that we are developing in a team. We are using SVN for version control and we are all running the exact same source code. I even tried checking out a fresh copy of the entire tree from SVN, but I had the same issue with reflection on my system while it worked for teammates.
The team created an executable jar and that ran on everyone's system fine except for mine. Everything worked for me except the reflection bit.
You need to debug your application. This means you have to systematically explore possible causes of the problem. Here are some things that come to mind:
Could your GUI be failing rather than reflection? What if you output with System.out.println() rather than your menu?
Is your reflection code throwing an exception, and are you ignoring it?
Is your reflection code actually being called? Toss a println() in there to be sure!
Is the test for the interface suffering from a typo or similar error that's causing it to fail? Try finding classes that implement Serializable instead!
Is your reflection test running in the main thread and trying to update your GUI? You need to use SwingUtilities.invokeAndWait to get an update to the Swing worker thread.
You're working with Eclipse; Eclipse has a fantastic debugger. Set a breakpoint near where your main action is and then single step through the code.
PATH and JAVA_HOME won't help. PATH only affects dynamically-linked libraries ("native code"). JAVA_HOME is a scripting variable that happens to be used by some Java-based utilities like Ant and Tomcat; it means nothing to the Java runtime itself.
You need to be investigating the classpath, which should be specified by the -classpath option to the java command, in the Build Path in your Eclipse project properties, or in the Class-Path attribute of the main section of a JAR file if you're launching java with the -jar option.
From within your code, you should be able to list the contents of your classpath by examining the system property, "java.class.path"
System.out.println(System.getProperty("java.class.path"));
Problem solution:
Classpath leading to source code must have no spaces in it.
I am running windows XP and, for whatever reason, if the classpath that leads to the jar file or source code that is using reflection has any spaces in it, then the reflection fails.
I took the jar file that works for the rest of my team and ran it from C:\ on my system and the reflection worked perfectly fine.
I do not know why this is so please comment if you know what is happening.
Might be a long shot, but look for differences in security settings for you and your team mates. Article describing more details http://www.ibm.com/developerworks/library/j-dyn0603/ heading "Security and reflection"