I can't seem to launch a .jar file. An error comes up when I launch it. Help would be appreciated, here is the error:
CouldNotLoadArgumentException[ Could not load file/URL specified: C:\Users\Donavon\AppData\Local\Temp\javaws12]
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
First, please check if your TEMP folder is still there.
Second, if you can find jawaaws12 in there, move it to somewhere else. Then uninstall and re-install java. The appropriate file should be created automatically.
Related
I am not able to build. I know the error is in jdkAnnotations.jar. I reinstalled android studio, but the problem persists. It also says no IDEA annotations attached in jdk 1.8. Should i reinstall jdk 1.8 also? i am clicking on the button that says attach annotations but nothing is happening. Please help. And why is this problem happening? is there something wrong in any xml resource file or what?
C:/Program Files/Android/Android Studio/lib/jdkAnnotations.jar!/java/awt/event/annotations.xml: Content is not allowed in prolog.
org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl$PrologDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
I got the same error today. Just reinstalling Android Studio did not help. The following steps worked for me:
Close Android Studio
Go to C:\Users\Username
Delete the whole folders: ".AndroidStudioX.X" and ".gradle"
Start Android Studio
Now all the Settings will be reinstalled and you can work on with your project
Had the same problem, it seems like others stated, a BOM problem, some HEX bytes at the begin of the file to mark its file format. To solve it:
Open C:/Program Files/Android/Android Studio/lib/jdkAnnotations.jar with winRar or other tool capable of editing .jar files.
Find annotations.xml in /java/awt/event/ iside the .jar and open it with a text viewer.
Copy its content to a new file with the same name (annotations.xml) anywhere in your computer.
Delete the original annotations.xml file inside the .jar file, and add your copy to the same location.
Then in your Android project project try to click in the Attach annotations option, and that should solve the problem.
Good luck!
My program runs fine when I run it on eclipse but when I package it in a jar file, I get this error when I run it.
java.lang.IllegalStateException: Location is not set.
at javafx.fxml.FXMLLoader.loadImpl(Unknown Source)
at javafx.fxml.FXMLLoader.load(Unknown Source)
at controller.MainController.initAnalyzer(MainController.java:144)
at applicationMain.Main.start(Main.java:32)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$162(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$173(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$148(Unknown Source)
at java.lang.Thread.run(Unknown Source)
I am certain that the path is correct. I have tried to change the path but nothing seems to work. I've also checked answers here and from other websites but nothing seems to solve my problem. It just does not make sense that my other FXML files under the same folder loaded well but not these three.
I think of the two following ways:
Make sure you set the path correctly. Anyway you should show us the folder system and how you set the path. Don't forget that the path starts from the current package, not the root of the project.
Clean and Build your project and run it again. It often somehow helps me to solve lots of issues.
When I run a jar file that accesses other files in the src directory, I get the following RuntimeException:
Exception in thread "main" java.nio.file.NoSuchFileException:
src\FileToBeAccessed.txt.lck
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.newFileChannel(Unknown Source)
at java.nio.channels.FileChannel.open(Unknown Source)
at java.nio.channels.FileChannel.open(Unknown Source)
at java.util.logging.FileHandler.openFiles(Unknown Source)
at java.util.logging.FileHandler.(Unknown Source)
at Program.main(Program.java:30)
The code works fine when I run it directly without building a jar file.
You'll need to change how you access resources in a jar to a stream.
this.getClass().getResourceAsStream("/file.txt");
The correct way is
this.getClass().getResourceAsStream("file.txt");
It is really strange that
this.getClass().getResource("file.txt")
does work in IDE but NOT when you run it from a jar.
this.getClass().getResourceAsStream("file.txt")
works both inside IDE and from jar.
I want to create an excutable file for my java project, previous time I do it by Jbuilder or netbean as I remember but I dont know how I should do it in JDeveloper to make Excutable file(EXE file)
please advice me, please describe clearly...
EDIT:
It's simple desktop application.it is not web application....
EDIT2:
I remove that part for checking argument and run my program I face with this problem:
what should I do?
Executing: C:\JDeveloper\mywork\SourceManagmentTools\Client\deploy\SMT.exe
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: oracle/jdeveloper/layout/VerticalFlowLayout
at Main.GUI.SmMainFrame.<init>(SmMainFrame.java:134)
at Main.GUI.SmRun.<init>(SmRun.java:25)
at Main.GUI.SmRun$1.run(SmRun.java:82)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: oracle.jdeveloper.layout.VerticalFlowLayout
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 17 more
Have you considered Launch4j?
Regarding your configuration problem, the Launch4J documetation says:
Additional JVM options at runtime
When you create a wrapper or launcher
all configuration details are compiled
into the executable and cannot be
changed without recreating it or
hacking with a resource editor.
Launch4j 2.1.2 introduces a new
feature that allows to pass additional
JVM options at runtime from an
.l4j.ini file. Now you can specify the
options in the configuration file, ini
file or in both, but you cannot
override them. The ini file's name
must correspond to the executable's
(myapp.exe : myapp.l4j.ini). The
arguments should be separated with
spaces or new lines, environment
variable expansion is supported, for
example:
# Launch4j runtime config
-Dswing.aatext=true
-Dsomevar="%SOMEVAR%"
-Xms16m
Other alternatives that you may consider are JSmooth,WinRun4J.
If your desktop application has a GUI, and you can distribute it from a site, look to Java Web Start.
JWS provides a 'one-click' installation option for the end user, automatic updates, desktop integration, splash screens and much more. It is part of the standard Java(1) distribution (since 1.4.2) & is supported by Oracle.
(1) JWS works with standard Jar files - no exe needed, which means it will work on *nix & Mac.
it so simple guys...
I solved my problem in this way...simplest way....
first of all check the version of java that installed in your client computer, you check by this command in CMD:
java -version
after you make sure about java version you need to make a bat file. [conflict in version maybe cause null except] after that you should know which external package u used in this project... for example I used 1 file for connecting to oracle database "ojdbc14" and the other for GUI, after that you can simply run your program or even pass parameter to them by just mention them at end of name of runable of your class:
java -client -classpath ojdbc14.jar;lipstikLF-1.1.jar;swing-layout.jar;smt.jar Main.GUI.SmRun rimrim
I guess those library we used in our project need also run, but I am not sure, I just suggest this work
java -client -classpath <name of you library>;<name of you library>;<name of your jar file> nameOfPackage.nameOfRunClass parameter[if any]
I will so appreciate if anybody add some useful info to this post
After upgrading to the latest java version (Java 6 update 13) a webstart application that was being used in production environments for many years, stopped installing with the following error:
java.lang.Exception: cache failed forhttp://localhost:8080/ReactorStudio/studio/installer.jnlp
at com.sun.javaws.Launcher.updateFinalLaunchDesc(Unknown Source)
at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
at com.sun.javaws.Launcher.launch(Unknown Source)
at com.sun.javaws.Main.launchApp(Unknown Source)
at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
at com.sun.javaws.Main$1.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The application jnlp is downloaded correctly and all the associated jar files. The application also contains a reference to an installer jnlp file that extracts a few files to the local disk the first the application is being run.
Any ideas on what is the problem, or how I could bypass this?
We had a similar issue when upgrading to the latest JRE. Our issue seemed to be related to this bug that should be fixed in 6u14. Perhaps your issue is also related.
The only workaround we found was to clear the webstart cache and launch the application again. In our experience this seems to be the solution to most webstart issues.
Try to remove href="..." from the "jnlp" tag of the "launch.jnlp" file.