Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

12045 Posts in 1593 Topics- by 593 Members - Latest Member: zhang

26. May 2013, 05:54:04 am
Xith3D CommunityProjectsYour Projects (Moderator: 'n ddrylliog)Digibots : first Alpha !
Pages: [1]
Print
Author Topic: Digibots : first Alpha !  (Read 2821 times)
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« on: 09. March 2007, 05:33:29 am »

Hi guys !

Could you please test it as much as possible ?

I did it with OneClick, the one tool I was working on. It's really wonderful : You select your workspace, You select your projects, You enter any keywords you want to exclude ("e.g. I entered the keywords : "lwjgl", "swt", "jaxb", "vorbis", "joal" cause I don't need any of them). You enter your main class and... that's it ! Self-launchable jar which *hopefully* manages all jars/natives stuff correctly.

It runs on Linux-i386. I tested it on Windows-i386 and it failed. I'm debugging that.

Thanks for testing.

You can get it here : http://mk3d.free.fr/digibots
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #1 on: 09. March 2007, 09:28:27 am »

Please reconsider the natives handling. I really dislike an application, that copies natives to my "C:\Windows\system32" directory, especially because it potentially breaks my development setup for other applications using the same native libraries. It also breaks deployment of JOGL java webstart applications. Also your ClassPathHacker might fail (does on windows?) to create a valid classpath environment. Despite the fact that you may not necessarily be able to dynamically add an URL to the SystemClassloader, there is no guarantee, that the SystemClassloader is an URLClassloader at all. It would be better to use an own classloader (maybe the WrapperClassloader from the vecmath-test) or no classpath hacking at all:

Since you already created a launcher, why not checking JAVA_HOME (and searching the PATH or well known JRE locations) and invoke a new JVM via Runtime.exec passsing the appropriate jvm arguments to setup the classpath and java.library.path.

This could potentially also solve the webstart issue on Mac Os X.

Mathias
Logged

horati
Global Moderator
Getting respectable
*****
Offline Offline

Posts: 393


View Profile
« Reply #2 on: 09. March 2007, 11:23:40 am »

Since you already created a launcher, why not checking JAVA_HOME (and searching the PATH or well known JRE locations) and invoke a new JVM via Runtime.exec passsing the appropriate jvm arguments to setup the classpath and java.library.path.

This could potentially also solve the webstart issue on Mac Os X.

Launching another JVM definitely might although I'm not sure how/if launching an executable works in JWS.  If you are able to launch a separate JVM, then you would want to place openmali.jar in the boot classpath rathern than the normal one by using -bootclasspath instead of -classpath.
Logged

Kevin
"It may not seem like a big deal, but ignorance of character encoding issues leads to insidious code rot akin to y2k."
http://stackoverflow.com/users/3474/sylvarking
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #3 on: 09. March 2007, 11:38:08 am »

Launching another JVM definitely might although I'm not sure how/if launching an executable works in JWS.  If you are able to launch a separate JVM, then you would want to place openmali.jar in the boot classpath rathern than the normal one by using -bootclasspath instead of -classpath.

I think the <allPermissions> security let's you do everything you want to. Placing the openmali.jar in the bootclasspath was the idea, this should effectively override the sun vecmath and I consider this more stable than an application level classloader.

Mathias
Logged

'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #4 on: 09. March 2007, 12:57:02 pm »

1. Yeah cylab I'll change that. I knew that was really hackish but I had a work to complete so.. Smiley
2. The separate JVM seems promising.. I'll try that.. I'll keep you up-to-date.
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #5 on: 09. March 2007, 01:07:09 pm »

OK first test with JVM launch from a program successful.
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #6 on: 09. March 2007, 03:29:51 pm »

OK OneClick now use a separate JVM to launch the program.

Several bugs fixed. Size reduced from 15.7MB to 8.3MB (for digibots).

Alpha 2's coming...
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #7 on: 09. March 2007, 03:44:02 pm »

Online.

Again, check out : http://mk3d.free.fr/digibots/
Logged
Mathias 'cylab' Henze
Fierce Warrior
****
Offline Offline

Posts: 540

1064620
View Profile WWW
« Reply #8 on: 09. March 2007, 04:40:50 pm »

There's a problem with spaces in the absolute jar path:
Code:
Exception in thread "main" java.io.FileNotFoundException: C:\Dokumente%20und%20Einstellungen\mhenze\Desktop\digibots-alpha2.jar (Das System kann den angegebenen Pfad nicht finden)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
        at org.oneclick.modules.JarFileExtractor.extract(JarFileExtractor.java:27)
        at org.oneclick.launcher.OneClickLauncher.main(OneClickLauncher.java:71)

After that, I testet to execute the jar from a path without spaces and there seems to be a problem extracting the natives, also:
Code:
Chosen library path = c:\WINDOWS\system32
We are running on : windows-i386
App natives path = C:\DOKUME~1\mhenze\LOKALE~1\Temp\oneclick_org.digibots.deployment.StandAloneApp858732843-22950603-1371646720-1628558173-406851623\natives
Is list of natives null ? yes
Exception in thread "main" java.lang.NullPointerException
        at org.oneclick.launcher.OneClickLauncher.main(OneClickLauncher.java:130)

and the "Please wait..."-dialog did not close on any of this errors.

Testsystem was a Windows XP notebook.

Some other notes:
  • use File.pathSeparator for separating the classpaths-entries; command.append(":./") might not work on other platforms than *nix
  • use new File(parentFile,"filename") instead of new File(parentFilepath + File.separator + "filename") where possible
  • your random temp directory is a bit overdone, simply use "oneclick"+System.currentTimeMillis()". It's very unlikely that someone might install 2 oneclick apps in the same milisecond Wink

Mathias
Logged

'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #9 on: 10. March 2007, 10:21:46 am »

There's a problem with spaces in the absolute jar path:
Code:
Exception in thread "main" java.io.FileNotFoundException: C:\Dokumente%20und%20Einstellungen\mhenze\Desktop\digibots-alpha2.jar (Das System kann den angegebenen Pfad nicht finden)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
        at java.util.jar.JarFile.<init>(Unknown Source)
        at org.oneclick.modules.JarFileExtractor.extract(JarFileExtractor.java:27)
        at org.oneclick.launcher.OneClickLauncher.main(OneClickLauncher.java:71)
Ah yeah right. Good'ol "%20" problem... That's not my first hack you know. I'll fix that.

After that, I testet to execute the jar from a path without spaces and there seems to be a problem extracting the natives, also:
Code:
Chosen library path = c:\WINDOWS\system32
We are running on : windows-i386
App natives path = C:\DOKUME~1\mhenze\LOKALE~1\Temp\oneclick_org.digibots.deployment.StandAloneApp858732843-22950603-1371646720-1628558173-406851623\natives
Is list of natives null ? yes
Exception in thread "main" java.lang.NullPointerException
        at org.oneclick.launcher.OneClickLauncher.main(OneClickLauncher.java:130)
    and the "Please wait..."-dialog did not close on any of this errors.
OK that's because the jar doesn't get extracted because it's not found because of the ugly %20. Hmm but that's strange if you say you tested it from a path without spaces..

  • use File.pathSeparator for separating the classpaths-entries; command.append(":./") might not work on other platforms than *nix
Yep. Infact I RTFSM (read the f* sun manual) and it told me it was always separated by ":" which I could hardly believe as in my experience in Windows it was separated by ";".. So ok I'll use pathSeparator.

  • use new File(parentFile,"filename") instead of new File(parentFilepath + File.separator + "filename") where possible
Right.

  • your random temp directory is a bit overdone, simply use "oneclick"+System.currentTimeMillis()". It's very unlikely that someone might install 2 oneclick apps in the same milisecond Wink
Hmmm.. maybe System.nanoTime() is safer... (WARNING ! WARNING ! I?M GETTING PARANOID !)
 Grin Grin Grin
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #10 on: 10. March 2007, 05:07:09 pm »

OK, Third Alpha.

Things changed :
- %20 bug
- Replaced new File() constructors
- Modified random temp dir
- Fixed pathSeparator problem
- Added progress bars
- Added extensive doc for all OneClick classes
- Fixed a *nasty* folder creation bug on Windows
- Probably several things I don't remember

Enjoy !

Amos Wenger
Logged
'n ddrylliog
Moderator
Guru
*****
Offline Offline

Posts: 1188



View Profile WWW Email
« Reply #11 on: 22. March 2007, 05:08:41 pm »

Hi guys !

I have the pleasure to announce you that Digibots! has been selected amongst 100+ as one of the best projects in my school. I accepted to present it at a Science Exposition in my school. It's not really important, yet I'm happy my work gets recognized.

So, thanks all for testing, your contributions to Xith3D and support !

Now, on to OneClick and Stratagem ! (prepare your network cards..  Wink  )
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic