creating a runnble jar with lwjgl - jar

I made a game using LWJGL and i need to be able to open it with a runnble jar.
the game contain another jar of program i made that let you build maps for the game so in the
game i can click on a button and the builder opens.
i tried to use jarsplice and i managed to open the jar of my game and see the main menu
however when i click on the button that open the game itself or the map builder the program
just crushed..
I have no idea what to do.... hope you can help me with that.
thanks.

Okay it looks like you need to debug the problem. Here is how I would do it:
Make the runnable fat jar using jarsplice
Put it in a new folder
Also in that folder create a file called run.bat
Edit run.bat with notepad++ (or another text editor) and paste this code into it
java -jar jarname.jar
PAUSE
Obviously replace jarname.jar with the name of your fat jar
Now when you run run.bat and you trigger the error you should be able to see the stack trace! If you can't solve the problem from that then post it here and I'll have a go at it.
Sorry that this isn't actually an answer, but it would be too hard to read if it was a comment.

Related

Qt Creator and QML Live Preview

The problem now is that I don't know how I can use qml live preview?
I saw a video:
https://vimeo.com/145921618
I saw this post about erase this function for Qt Creator.
How i can implementlive coding into my app?
Perhaps you mean Terrarium?
Terrarium is a cross platform QML Playground: the view renders lively
as you type in the editor, makes prototyping and experimenting with
QtQuick a lot more fun!
It monitors changes in its TextEdit, and triggers the view to reload
source from the local http server. If you're looking for a file system
watcher implementation, please refer to QML LiveReload.
Or LiveReload?
As is evident from the video, this is as simple as auto reloading a QML file each time a chance to the file has been saved.
You can easily do that yourself, set up a QFileSystemWatcher and every time the file is modified, load the file in a QML view. And there you have it.
Of course, this is only good for previewing standalone components which can work on their own. You could go further, set the file system watcher to monitor the entire QML project and reload the main QML file every time something changes. It is a two step process, you need to monitor the directory, which only reflects adding or removing of files, and you subsequently add or remove those files from watching for changes.
Just for the sake of it, I want to share another tool that I found online.
It is a web based QML editor that gives immediate preview while writing the code. It has its limits, but still it's pretty useful for live QML coding
https://qmlweb.github.io/
If someone is still interested, in my Qt 5.10 installation, there is a qmlscene.exe in bin folder (same location as qmake or assistant). Running on command line is fine, however it is not in Qt creator.
PS: I found this:
http://doc.qt.io/qt-5/qtquick-qmlscene.html

javafx jar builds fine but doesn't open

So i created a javafx project, it has 3 packages, application, controller, and an images package that holds all the images im using. The program runs fine if i just compile and run, no errors. However, when i create a jar from it, by selecting the build.fxbuild, everything goes smoothly and it tells me it is successful but when i try to double click the jar file nothing opens but java starts running in the background until i force close it. Im running OSX yosemite, and im on java 1.8 if that helps at all. I've tried making the jar through the export option but it doesnt run either and just says that it cant open the file. The weird thing is i made another javafx project just to see if it would work, same settings but just something simple, a window that pops up and says a line, then exported to a jar by clicking build.fxbuild and when i double click the jar it made it works perfectly.
I'm at a loss for what is preventing my other javafx project from working as a jar file and the other similar posts ive found on here haven't solved it either. Any ideas?

Sometimes Scene Builder in JavaFX doesn't open

It's really getting annoying and tiresome when I'm working really hard on something I need to complete and then I need to make a few changes to the GUI so I open Scene Builder and it doesn't open up.
I've tried
- Closing Eclipse and opening it.
- Killing the scene builder process and opening it.
What works
- Logging off and logging on and then opening eclipse & the scene builder.
This is starting to make me lose taste in JavaFX. Though I have to use this over Swing.
Also, when I open Scene Builder (from my desktop) it opens up just fine, though when I navigate to my Main.FXML (inside my project). Scene Builder can't be opened. It just does nothing when I open it, and it minimizes.
Even though this question has been asked some time ago, I want to contribute my solution to this problem because it differs from the other solutions and in addition is very simple.
This particular problem happened to me just a few mins ago and all I took to solve was maximizing the actual Scenebuilder window!
Open the Windows Taskmanager
Switch to the applications tab
Right click the SceneBuilder (named: yourFileName.fxml)
Select 'Maximize'
Description above works for Windows OS, on other OS the corresponding application managing program should do the same.
That worked for me just perfect. No copying and/or overwriting needed.
Its not the perfect answer but it works well. Try doing the following
1.Open scene builder directly from your local drive.
2.Click on File-> Open Recent -> Clear Menu
Then try to open up your fxml.
Works fine for me.
I am having the same problem. It appears that either SceneBuilder or IntelliJ IDEA put my FXML file in a state that Scenebuilder can't parse.
You may find it helpful to edit the logging.properties file and reopen the bad FXML file. On windows it's %ProgramFiles(x86)%\Oracle\JavaFX Scene Builder 2.0\app\logging.properties. You can set
.level = ALL
Then examine the file %TEMP%\scenebuilder-2.0.log for clues.
Valid java.util.Logging levels in descending order are:
OFF
SEVERE
WARNING
INFO
CONFIG
FINE
FINER
FINEST
ALL
Also, copy the FXML file to a temp dir. Try to open it there. I did that and it appears to have fixed the problem.
For me, copying the code from the .fxml file that didnt work with scenebuilder to a new (!) .fxml file on lets just say the desktop and then opening that one worked. After I opened the new file I saved and overwrote it back to where it was in my source folder, and it worked just fine from there on.
Open scene builder directly from your local drive.
Click on File-> Open Recent -> Clear Menu
this also works for me, try this

android studio adding extern jar library

I would like to add the extern jar library commons-jexl-2.1.1.jar. I copied the jar into the libs/ folder and performed the Add as library... menu point. I don't receive any errors in the code and everything seems to work but when compiling and starting the application I receive the error java.lang.NoClassDefFoundError: org.apache.commons.jexl2.JexlEngineon this line private JexlEngine jexl = new JexlEngine();
Does anyone know what I've missed?
Unfortunately, that menu command is doing the wrong thing for Gradle-based projects, which I assume yours is. (Gradle-based projects are what you get when you create new projects in Android Studio). I've filed bug https://code.google.com/p/android/issues/detail?id=62249 to request implementing this menu command properly for these projects, or at a minimum disabling it until it's implemented to prevent confusion.
In the meantime, you can add external JAR dependencies by going through the Project Structure dialog, which will add the appropriate entries to your build.gradle build file. Choose File menu > Project Structure, and click on the "Modules" entry on the left. Choose your module from the middle list, and click on the Dependencies tab on the right. Then click on the + button at the bottom to add a new dependency. Screen shot here:
The + menu has an option for "File dependency" (pictured). You will get a file chooser that will let you select the jar file.
If your dependency is one that can be found in Maven, you may find it more convenient to specify the Maven coordinates; that way, the build system will automatically download the dependency, and you won't have to download and store the JAR manually. To set that up, choose "Maven dependency" from the + menu. You'll get a dialog where you can search to find the proper Maven coordinates for your library. In your case, those coordinates will be "org.apache.commons:commons-jexl:2.1.1#jar"
If you prefer to edit build files by hand, check out your build.gradle file after completing the Project Structure dialog changes to see what it did.
The docs for using Gradle in Android are at http://tools.android.com/tech-docs/new-build-system
courtesy The App Chaps
I've been struggling with the same thing for many hours, trying to get the Gson jar to work no less. I finally cracked it – here are the steps I took:
Put the Gson jar (in my case, gson-2.2.4.jar) into the libs folder
Right click it and hit 'Add as library'
Ensure that compile files('libs/gson-2.2.4.jar') is in your build.gradle file
Do a clean build (you can probably do this fine in Android Studio, but to make sure I navigated in a terminal to the root folder of my app and typed gradlew clean. I'm on Mac OS X, the command might be different on your system
After I did the above three, it started working fine. I think the 'Add as library' step was the one I'd previously missed, and it didn't work until I cleaned it either.
[Edit - added the build.gradle step which is also necessary as others have pointed out]

Save Opened Files Per Project

I've been using Aptana and it is a great tool for web development. I don't know if I can resort myself going back to Notepad++
Anyway, I have multiple project on Aptana ... I think it is stored in a single workspace. But I switch over to other projects depending on my mood. In each project, I have multiple files opened and it kind of destroys momentum that I have to close the windows of my previous projects and open the files on the projects I want to work on.
My question: Is there a way to save the opened files per project. Like when i switch to Project A, all of the files I opened in project A will open. When I switch to project B, all of the files I opened in Project B is opened?
I decided to play around with "workspaces", and although there isn't a very GUI oriented way of working with these collections yet, I came up with a workable solution!
Create a new folder in your home directory, and just call it "workspaces", then open up Aptana, and choose File -> Switch Workspace -> Other and then type in the path to the new "workspaces" folder, and then the name of the workspace. I have one workspace called "generic" where I pretty much have every project loaded up. Then I have a bunch of workspaces named after the project to which they are committed. No more reluctance to switch tasks in Aptana! No more opening up bits and pieces of projects in Notepad++ or Sublime! Everything is good again!
Now all Aptana really needs to do is make a menu where you can click to select which workspace to use when aptana loads instead of having to remember your-exact_project-name and being able to refresh your memory by looking at all the workspaces you have. Ideally they would impliment a kind of search/filter bar after you start typing your project name, and then a hoverup that say "hit enter to auto complete" since there's no standard practice as to whether tab or enter should be autocomplete, and sometimes making it enter can be anoying cause you just wanted to make a new project called 'ant' not load your engineering project named'antennas'.
Anyway, sorry for the formatting. Hope this helps.

Resources