Running java on windows 8




















Just run it and your Java apps is back If you need to distribute your. An interesting side effect of this causes a problem when starting runnable jar files in the command prompt.

EDIT: However you then get a black console window when you run a form based non console Java app, so this is not an ideal solution. If you run these jar files by double clicking them in windows, no parameters will be passed so your Java code needs to handle the stack overflow exception and include a "press a key" function at the end or the window will just disappear.

In order to pass a parameter in windows you have to create a shortcut to the jar file, which includes the parameter in the target line right click on the shortcut and select properties you can not add parameters to the jar file icon itself in this way.

There isn't a single, consistent solution here, but you would have the same problem with any other console application. There is a windows freeware application called "bat to exe" which you can use to create an exe file from a.

There is way without requiring user to do changes on his PC. So, it's possible for java program to run itself in command prompt when user clicks.

Besides all of the other suggestions, there is one other thing you need to consider. Is your helloworld. If it is, then I don't believe you'll be able to make it into a double-clickable jar file.

Console programs use the regular cmd. Usually the jar "launcher" is bound to javaw. Double click on default on the left and add -jar between the java. There is an archive which you can download containing a. You want to check a couple of things; if this is your own jar file, make sure you have defined a Main-class in the manifest. Since we know you can run it from the command line, the other thing to do is create a windows shortcut, and modify the properties you'll have to look around, I don't have a Windows machine to look at so that the command it executes on open is the java -jar command you mentioned.

The other thing: if something isn't confused, it should work anyway; check and make sure you have java associated with the. Unfortunatelly, it is not so easy as Microsoft has removed advanced file association dialog in recent Windows editions.

It will probably be listed as " Java Platform SE ". A faster alternative perhaps is straightforward right-click on a. Luckilly for us, we may specify parameters there for the Default value. I had the same problem in Windows I fixed it using righ-click on the " helloworld.

In the " Open with Then next time your " helloworld. For example, you would rename the file MyJar. You must have the. This might not work in all cases, but it has worked most times for me. PreScript : If your prompt appears and disappears immediately, the reason it does so is that your program gets executed and auto shut. Try putting a scanner in the end to terminate and it'll keep your prompt waiting for input before terminating.

Or use delay maybe. I created a program using javaexe, a wrapper for java programs that allows them to be launched by an exe file. The program has been working since a few years on a winXP computer, but I would like to launch it from my win8. Do you know where does the problem come from? My computer uses windows 8. I obviously tested my program having disabled these 2 security programs avast!

I use also JavaExe for an interactive service and I tested it on Windows 8. When I install the service, I right-click and run it "as admin". But, if I fix the. I tested also the examples of JavaExe example8 and 23 and it also works. Have you the same problem with JavaExe's examples? Stack Overflow for Teams — Collaborate and share knowledge with a private group.

Yes No. Sorry this didn't help. Thanks for your feedback. Was this reply helpful? The process I described in the previous post, have Encountered problems. So I have edited the post. I have tested the current process in my PC windows 8 pro WMC x64 and its running without any problem. I apologies for any problem you have faced after trying the previous process. It would be more help full if you create a system restore point before trying any trick described in the net.

Because each JRE will be installed in different folders, it usually does not matter. When running different versions of jre, your application will search for the Java executable using the PATH variable. You can modify the path to use a certain Java version e. Or you can manually add the version you want to use, first in the PATH variable. Remember the first instance of java.

Java Downloads for All Operating Systems. Consider going to your settings , choosing your active profile then click on advanced settings , now on the menu that pops up and choose the version you would like to work with.

Once everything is configured use the terminal to verify the usage of the right version. Now incaqse thus pdate-alternatives --config java. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Running java in 32 bit mode on windows 64 Ask Question. Asked 7 years, 7 months ago. Active 1 year, 1 month ago.

Viewed 45k times.



0コメント

  • 1000 / 1000