Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting JVM options #44

Closed
nournia opened this issue Nov 15, 2012 · 3 comments · Fixed by #110
Closed

Setting JVM options #44

nournia opened this issue Nov 15, 2012 · 3 comments · Fixed by #110

Comments

@nournia
Copy link

nournia commented Nov 15, 2012

Is there any way to set JVM heap size? something that works like this:

java -Xmx512m

And there are some questions about CLASSPATH. When I set it in code, can't find my classes:

environ['CLASSPATH'] = 'absolute/path/file.jar'

Even setting that out of my python file, doesn't change anything:

export CLASSPATH="absolute/path/file.jar"
@JoshRosen
Copy link

I ran into a similar problem with the CLASSPATH; it looks like it needs to be set before importing jnius.

I'm also curious about setting JVM options.

@davidcheng0716
Copy link

I have the same problem and I the "make tests" command didn't run any test case.

make tests
javac jnius/src/org/jnius/NativeInvocationHandler.java
...
4 warnings generated.
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. -g build/temp.macosx-10.9-intel-2.7/jnius/jnius.o -o /Users/hotdog16/Downloads/pyjnius-master/jnius/jnius.so -framework JavaVM
cd tests && javac org/jnius/HelloWorld.java
cd tests && javac org/jnius/BasicsTest.java
cd tests && javac org/jnius/MultipleMethods.java
cd tests && javac org/jnius/SimpleEnum.java
cd tests && javac org/jnius/InterfaceWithPublicEnum.java
cd tests && javac org/jnius/ClassArgument.java
cd tests && env PYTHONPATH=..: nosetests-2.7 -v
Ran 0 tests in 0.002s

OK

When I run test by myself:
cd tests/
PYTHONPATH=..: nosetests test_basics.py
EEEEEEEEEEEEE
ERROR: test_instance_fields (test_basics.BasicsTest)
Traceback (most recent call last):
File "/Users/hotdog16/Downloads/pyjnius-master/tests/test_basics.py", line 43, in test_instance_fields
test = autoclass('org.jnius.BasicsTest')()
File "/Library/Python/2.7/site-packages/jnius/reflect.py", line 150, in autoclass
c = find_javaclass(clsname)
File "jnius_export_func.pxi", line 23, in jnius.find_javaclass (jnius/jnius.c:12356)
JavaException: Class not found 'org/jnius/BasicsTest'
....

@davidcheng0716
Copy link

Solved, The mac OS X jdk issue.
Go to mac developer page and search java to download the newest jdk(JavaForOSX2013-05.dmg)
https://developer.apple.com/downloads/index.action
reinstall pyjnius, it work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants