I have a Java application from one of our suppliers. After installing the application as Admin, I try to open the application as Admin, but nothing happens. I have gone to where the program icon points to, and it goes to a Javaw.exe file:
"C:\Program Files (x86)\Infra12\jre\bin\javaw.exe" -jar Infra12.jar
If I run this Javaw.exe file directly as Admin, nothing still happens. By nothing, I mean there are no windows that open at all.
I have run sfc /scannow and it found nothing.
I didn't have Java itself installed, so I thought maybe that was the issue. So I installed Java (Java 8 Update 191), uninstalled the Java application then reinstalled it, still nothing happens when I try to open it.
I can't go back to the supplier, as they don't support the software any more - it is used to communicate with infrastructure equipment.
Any ideas how I can get this application to work?
Edit
Not sure if this makes a difference, seems to refer to some variables - maybe that can help with opening it?
This is because javaw points to the Java Virtual Machine. If you want to run the application - find the .jar it uses and then double-click that. Or use javaw to run said application:
[WIN] + [R]
Type "cmd"
Enter: javaw -jar path-to-your-jar-file
javaw by itself will do nothing.
EDIT: You need to use the -jar option.
Related
I want to automatically run a Java application under Windows at startup time, but not depending on a specical Windows or a special JRE-version.
Generally, a good way to run programs at Windows login time would be to add a registry entry under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
But it seems as if the system PATH is not evaluated when Windows tries to run the programs listed in the registry's RUN section.
So these both entries do work:
"C:\Program Files\Java\jdk1.8.0_111\bin\javaw" -jar c:\path\to\java.jar
"C:\ProgramData\Oracle\java\javapath\javaw" -jar c:\path\to\java.jar
But this one doesn't come up:
javaw -jar c:\path\to\java.jar
Now, the latter works when manually entered in a console window because there the required PATH exists and is evaluated:
PATH=....;C:\ProgramData\Oracle\Java\javapath;....
Now, I want to have the registry entry added from an automated installer programm and I would like to have it formed "windows-system-independent" (from Vista up to Win 10, and furthermore not depending from the version of the installed JRE). So I do not know a general path to the JRE and therefore I cannot add a specific RUN-command to the registry.
Does anyone know how to add JRE-calls system-independent correctly to the registry's RUN-section?
I've already tried with a command-file, e.g. "startup.cmd" with content java -jar file.jar there, have added a call of this file to the registry, and yes that worked, java was found, the application was started, but when using this method I have an annoying black command terminal window staying open all the time while the java app is running.
Thanx,
Tombo
Change your startup.cmd, from
java -jar file.jar
to
start java -jar file.jar
This will launch the java.exe in a new process an let your batch executor terminate.
What the title says really. I've tried exporting it to a Runnable Jar File, checked the Manifest.MF, and tried running it with Java multiple times but with no luck. However, it does work when I navigate to the file using the command prompt and launch is using java -jar Name.jar. This shows it works but I just can't get it to launch by double clicking.
I guess you're trying to launch a commandline-app. This kind of application can be launched by double-clicking aswell. There's only one problem: Java doesn't create a commandline-window by default and instead uses the commandline of the parent-process of the JVM, which in case of double-clicking doesn't own a console-window. In other words: the output to the console gets lost somewhere in the depths of your OS and the JVM and the program hangs as soon as any input is expected.
(Assuming your on Windows OS), if you right-click on it, do you see the option 'Open with' and then 'Java (TM) Platform SE binary', or something like that? And if you opt to open with that, does it execute?
If so, then you've probably set .jar files to open with a different application by default. For example, I have my computer set up to open .jar files with jd gui as the default application.
Eclipse froze on me earlier today, so I typed "top" into the command prompt and killed it. Now when I try to run a java application, I get this error:
eclipse\plugins\org.eclipse.jdt.debug_3.7.0.v20110509
That's all that shows up under details.
None of my previously working programs run, and I have no clue what this is. I have Eclipse 1.5.0 running 1.6 and 1.7 Java, depending on what program. Thanks for any help.
It is possible that you killed part of the process but not all of it. It is possible that a java process is running with a reference to this job. I would try restarting your computer to see if it will stop whatever process is referencing that jar.
Aside from a restart, then another option would be to use (in linux) pstree, filtered for your user to see if any other jobs are referencing that jar and/or java.
EDIT:
Another path is to look at log files. On linux they are in /var/log. Here's a link in that direction: http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/felog.html
I am trying to run a simple JAVA program once per day on a Windows 7 machine.
My code runs fine inside NetBeans. If I do a clean and build it suggests this:
C:\Program Files\Java\jdk1.7.0/bin/java -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
This does not work from the DOS prompt of course because of the space between program and files so I do this:
C:\Program Files\Java\jdk1.7.0/bin/java -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
This works from the DOS prompt.
I now create a task in Windows Scheduler to run:
C:\Program Files\Java\jdk1.7.0/bin/java
with arguments:
-jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
When I then run it, all I see is a DOS box flashing up for a second. I expect the code to take about 30 secs to run. The code should persist data to a database and no updates happen.
The code also uses java.util.logging so I should see log entries and I don't.
I strongly suspect that I am not running the JAVA command properly or that there's a bad classpath issue that it present when running via Scheduler that isn't there when running from the DOS prompt.
Help would be appreciated. If you've seen this before and can sort it that would be great. If you can tell me how to get a meaningful error trace from Scheduler than that would also be really helpful.
Thanks!
I Think that you could create a simple batch script that will launch your program in this way :
#echo off
REM Eventually change directory to the program directory
cd C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\
REM run the program
"C:\Program Files\Java\jdk1.7.0\bin\java.exe" -jar "C:\Users\User1\Documents\NetBeansProjects\Facebook\dist\Facebook.jar"
Copy it into the notepad and save as java_script.cmd and then schedule this script instead of the program directly.
I solved it after changing all fonts' references to "SansSerif"
I was using Jasper Reports inside Java to create a PDF file. It was working fine when I double click the batch file or Scheduler with Windows Server 2003 but not working with the Scheduler of 2008.
I tried many different things nothing worked so I though Could it be that Windows Server 2008 is blocking the access?.
Now is working perfect. So, if you are having problems check the references to anything you are using.
The scheduler will run under a different user unless you specify what user to run as. If it isn't running as your user then it won't be able to write to your directories.
The real problem to the original question is a java installation issue on Microsoft systems. Java jre installs into Program Files\java. The executable (java.exe) is only installed in that java\bin directory. Running from the command line, the os looks in the proper location for the java.exe. Running from other MS tools (such as VBA Excel or in this case TaskScheduler), it does not!
You can see that TaskScheduler is looking in the wrong place by viewing the tasks history in the TaskScheduler tool. Double click on some of the history events and one will list the action and return code. The action will show that the TaskScheduler is trying to run
"C:\Windows\system32\java.EXE"
So, copy java.exe from the java\bin directory into the place where the scheduler is looking, and now it will work.
Or update your task and provide the full path to java.exe.
You can also update the environment system path to look for java in the java\bin directory, but that has to apply to all users and sometimes this is faulty as well.
I am building a swing application (a file explorer) that has to copy/move files/folders around. When I try to copy to some folders such as Program Files, it throws an exception (access denied). I can solve by running NetBeans as administrator.
Is there anyway I can give admin rights to my project only, without running the whole Virtual Machine as admin?
You could, for a really horrible non-cross-platform method, use VBScript's .ShellExecute and Runtime.exec to force a program to run as an administrator.
For brevity's sake, I have created a simple program available at
https://dl.dropbox.com/u/26746878/Misc/JavaElevated.zip
It can be run with java Launcher.
From NetBeans, I'd assume you'd somehow get it to run the Launcher as the main class instead of the main Program.
Is there not a command line startup, I'm sure there is and that there is a guy(ette) out there who would write it out for us in about 10 hot seconds. Windows 7/64